From 0772cf8b98387b2b641ae29aeb1b459eef22d794 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Wed, 22 Mar 2017 22:59:07 +0100 Subject: Blocker fixes --- src/blocker/blockerrule.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/blocker/blockerrule.h') 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; -- cgit v1.2.1