diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-03-22 22:59:07 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-03-22 22:59:07 +0100 |
commit | 0772cf8b98387b2b641ae29aeb1b459eef22d794 (patch) | |
tree | 9ee8048e85e1fc8a11a6e88b6d8829d5784d6a4c /src/blocker/blockerrule.h | |
parent | Profile saving and loading (diff) | |
download | smolbote-0772cf8b98387b2b641ae29aeb1b459eef22d794.tar.xz |
Blocker fixes
Diffstat (limited to 'src/blocker/blockerrule.h')
-rw-r--r-- | src/blocker/blockerrule.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/blocker/blockerrule.h b/src/blocker/blockerrule.h index 0981514..85a5dc1 100644 --- a/src/blocker/blockerrule.h +++ b/src/blocker/blockerrule.h @@ -30,6 +30,8 @@ class BlockerRule : public QObject { Q_OBJECT public: + + // https://adblockplus.org/en/filters#options enum RuleOption { script = 1, image = 2, @@ -41,14 +43,11 @@ public: ping = 128, websocket = 256, document = 512, - elemhide = 1024, generichide = 2048, genericblock = 4096, - other = 8192 }; - Q_DECLARE_FLAGS(RuleOptions, RuleOption) explicit BlockerRule(QString rule, QObject *parent = 0); @@ -56,17 +55,22 @@ public: bool match(const QWebEngineUrlRequestInfo &info); bool isValid(); bool isException(); - QString toString() const; + QString filter() const; signals: public slots: private: + void parseOption(const QString &opt); bool matchOptions(const QWebEngineUrlRequestInfo &info, const RuleOptions &options); + QString m_filter; + bool m_valid; bool m_exception = false; + bool m_elementRule; + QStringList hostsBlacklist; QStringList hostsWhitelist; RegExp domainExpression; |