aboutsummaryrefslogtreecommitdiff
path: root/src/webengine/adblockrule.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-01-23 15:42:14 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-01-23 15:42:14 +0100
commitd886b377ac168d32668b5f3d145279a4f64de730 (patch)
treeb5547077ce555e8c609495fc6b3851b827abbb3d /src/webengine/adblockrule.cpp
parentRemoved window/title config (diff)
downloadsmolbote-d886b377ac168d32668b5f3d145279a4f64de730.tar.xz
URL blocking
Diffstat (limited to 'src/webengine/adblockrule.cpp')
-rw-r--r--src/webengine/adblockrule.cpp12
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();
+}