feat(browser): log blocked requests

This commit is contained in:
Oleg Shparber 2020-05-10 11:28:47 -04:00
parent 3ee3b9a5c4
commit 0c47b3bbb1

View File

@ -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)
{
@ -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);
}