diff options
Diffstat (limited to 'src/webengine/urlinterceptor.cpp')
-rw-r--r-- | src/webengine/urlinterceptor.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
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())); +} |