X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=src%2Finterceptors%2FUrlRequestInterceptor.cpp;h=634889867ad386464e5472b1d01c5ff1ccca6075;hb=b105f2cce889a132faa9d7a5cdc8505b75965321;hp=2b9bd053e8c0da3c31b7a3c2bb7f5d59a93cd286;hpb=bbc06827f4301381ee3882000abbba147607aa35;p=PrivacyBrowserPC.git diff --git a/src/interceptors/UrlRequestInterceptor.cpp b/src/interceptors/UrlRequestInterceptor.cpp index 2b9bd05..6348898 100644 --- a/src/interceptors/UrlRequestInterceptor.cpp +++ b/src/interceptors/UrlRequestInterceptor.cpp @@ -20,7 +20,13 @@ // Application headers. #include "UrlRequestInterceptor.h" -// The default constructor. +// KDE Framework headers. +#include + +// Qt framework headers. +#include + +// Construct the class. UrlRequestInterceptor::UrlRequestInterceptor(QObject *parentObjectPointer) : QWebEngineUrlRequestInterceptor(parentObjectPointer) {} void UrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &urlRequestInfo) @@ -42,9 +48,7 @@ void UrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &urlReques // Reapply the domain settings if the host is changing. if (requestingHost != requestedHost) - { emit applyDomainSettings(requestedHost); - } } break; @@ -64,6 +68,25 @@ void UrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &urlReques // Block HTTP ping requests. urlRequestInfo.block(true); + // Instantiate an HTTP ping blocked message box. + QMessageBox httpPingBlockedMessageBox; + + // Set the icon. + httpPingBlockedMessageBox.setIcon(QMessageBox::Information); + + // Set the window title. + httpPingBlockedMessageBox.setWindowTitle(i18nc("HTTP Ping blocked dialog title", "HTTP Ping Blocked")); + + // Set the text. + httpPingBlockedMessageBox.setText(i18nc("HTTP Ping blocked dialog text", "This request has been blocked because it sends a naughty HTTP ping to %1.", + urlRequestInfo.requestUrl().toString())); + + // Set the standard button. + httpPingBlockedMessageBox.setStandardButtons(QMessageBox::Ok); + + // Display the message box. + httpPingBlockedMessageBox.exec(); + break; }