X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=blobdiff_plain;f=src%2Finterceptors%2FUrlRequestInterceptor.cpp;fp=src%2Finterceptors%2FUrlRequestInterceptor.cpp;h=634889867ad386464e5472b1d01c5ff1ccca6075;hp=d4059285576e1c469ac76178fb50fcb912073e4a;hb=b105f2cce889a132faa9d7a5cdc8505b75965321;hpb=823acbeb2cc27030857f249ab7157d8562e7b7fe diff --git a/src/interceptors/UrlRequestInterceptor.cpp b/src/interceptors/UrlRequestInterceptor.cpp index d405928..6348898 100644 --- a/src/interceptors/UrlRequestInterceptor.cpp +++ b/src/interceptors/UrlRequestInterceptor.cpp @@ -20,6 +20,12 @@ // Application headers. #include "UrlRequestInterceptor.h" +// KDE Framework headers. +#include + +// Qt framework headers. +#include + // Construct the class. UrlRequestInterceptor::UrlRequestInterceptor(QObject *parentObjectPointer) : QWebEngineUrlRequestInterceptor(parentObjectPointer) {} @@ -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; }