diff options
Diffstat (limited to 'src/webengine/adblockrule.cpp')
-rw-r--r-- | src/webengine/adblockrule.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/webengine/adblockrule.cpp b/src/webengine/adblockrule.cpp new file mode 100644 index 0000000..fe3e64e --- /dev/null +++ b/src/webengine/adblockrule.cpp @@ -0,0 +1,12 @@ +#include "adblockrule.h" + +AdBlockRule::AdBlockRule(QString rule, QObject *parent) : + QObject(parent) +{ + ruleExpression.setPattern(rule); +} + +bool AdBlockRule::match(const QUrl &url) +{ + return ruleExpression.match(url.toString()).hasMatch(); +} |