From 0250559bcf5764fb8cf3a8ccc4e330b8ed855f96 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Tue, 24 Jan 2017 16:09:07 +0100 Subject: Blocker UI --- src/webengine/urlinterceptor.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/webengine/urlinterceptor.cpp (limited to 'src/webengine/urlinterceptor.cpp') diff --git a/src/webengine/urlinterceptor.cpp b/src/webengine/urlinterceptor.cpp new file mode 100644 index 0000000..87879a5 --- /dev/null +++ b/src/webengine/urlinterceptor.cpp @@ -0,0 +1,19 @@ +#include "urlinterceptor.h" + +AdBlockInterceptor::AdBlockInterceptor(QObject *parent) : + QWebEngineUrlRequestInterceptor(parent) +{ +} + +void AdBlockInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info) +{ +// bool blocked = false; +// for(AdBlockRule *rule : m_urlBlacklist) { +// if(rule->match(info.requestUrl())) { +// info.block(true); +// blocked = true; +// } +// } + + qDebug("%i %i %s %s", info.navigationType(), info.resourceType(), qUtf8Printable(info.requestMethod()), qUtf8Printable(info.requestUrl().toString())); +} -- cgit v1.2.1