- // Check the filter lists.
- bool continueProcessing = globalFilterListHelperPointer->checkFilterLists(privacyWebEngineViewPointer, urlRequestInfo, requestStructPointer);
+ // Create a continue processing flag.
+ bool continueProcessing = true;
+
+ // Block certain resource types.
+ switch (urlRequestInfo.resourceType())
+ {
+ case QWebEngineUrlRequestInfo::ResourceTypeNavigationPreloadMainFrame:
+ case QWebEngineUrlRequestInfo::ResourceTypeNavigationPreloadSubFrame:
+ {
+ // Block the request.
+ urlRequestInfo.block(true);
+
+ // Mark the request struct as blocked.
+ requestStructPointer->dispositionInt = FilterListHelper::BLOCKED;
+
+ // Mark the preload request as blocked by the default behavior.
+ requestStructPointer->filterListTitle = i18nc("Default preload blocking", "Default blocking of all preload requests.");
+
+ // Set the continue processing flag.
+ continueProcessing = false;
+
+ break;
+ }
+
+ default:
+ {
+ // Do nothing.
+ break;
+ }
+ }
+
+ // Check the filter lists if it hasn't already been handled.
+ if (continueProcessing)
+ continueProcessing = globalFilterListHelperPointer->checkFilterLists(privacyWebEngineViewPointer, urlRequestInfo, requestStructPointer);