aboutsummaryrefslogtreecommitdiff
path: root/src/blocker/blockerrule.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/blocker/blockerrule.h')
-rw-r--r--src/blocker/blockerrule.h12
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;