diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-01-23 15:42:14 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-01-23 15:42:14 +0100 |
commit | d886b377ac168d32668b5f3d145279a4f64de730 (patch) | |
tree | b5547077ce555e8c609495fc6b3851b827abbb3d /src/webengine/adblockrule.cpp | |
parent | Removed window/title config (diff) | |
download | smolbote-d886b377ac168d32668b5f3d145279a4f64de730.tar.xz |
URL blocking
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(); +} |