Skip to content

Commit

Permalink
feat(browser): log blocked requests
Browse files Browse the repository at this point in the history
  • Loading branch information
trollixx committed May 10, 2020
1 parent 3ee3b9a commit 0c47b3b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libs/browser/urlrequestinterceptor.cpp
Expand Up @@ -27,8 +27,12 @@
#include <core/networkaccessmanager.h>
#include <core/settings.h>

#include <QLoggingCategory>

using namespace Zeal::Browser;

static Q_LOGGING_CATEGORY(log, "zeal.browser.urlrequestinterceptor")

UrlRequestInterceptor::UrlRequestInterceptor(QObject *parent)
: QWebEngineUrlRequestInterceptor(parent)
{
Expand Down Expand Up @@ -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);
}

0 comments on commit 0c47b3b

Please sign in to comment.