From 0c47b3bbb1d86fdec453d76e7067c8ac6a2bc016 Mon Sep 17 00:00:00 2001 From: Oleg Shparber Date: Sun, 10 May 2020 11:28:47 -0400 Subject: [PATCH] feat(browser): log blocked requests --- src/libs/browser/urlrequestinterceptor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libs/browser/urlrequestinterceptor.cpp b/src/libs/browser/urlrequestinterceptor.cpp index bb324a6..f6ff657 100644 --- a/src/libs/browser/urlrequestinterceptor.cpp +++ b/src/libs/browser/urlrequestinterceptor.cpp @@ -27,8 +27,12 @@ #include #include +#include + using namespace Zeal::Browser; +static Q_LOGGING_CATEGORY(log, "zeal.browser.urlrequestinterceptor") + UrlRequestInterceptor::UrlRequestInterceptor(QObject *parent) : QWebEngineUrlRequestInterceptor(parent) { @@ -77,5 +81,6 @@ void UrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info) void UrlRequestInterceptor::blockRequest(QWebEngineUrlRequestInfo &info) { + qCDebug(log, "Blocked request: %s '%s'.", info.requestMethod().data(), qPrintable(info.requestUrl().toString())); info.block(true); }