- // Handle the request according to the resource type.
- switch (urlRequestInfo.resourceType())
- {
- // A naughty HTTP ping request.
- case QWebEngineUrlRequestInfo::ResourceTypePing:
+ // Clear the requests list if a main frame resource is being loaded.
+ if (urlRequestInfo.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMainFrame)
+ emit newMainFrameResource();
+
+ // Create a requests struct.
+ RequestStruct *requestStructPointer = new RequestStruct;
+
+ // Store the basic request information.
+ requestStructPointer->navigationTypeInt = urlRequestInfo.navigationType();
+ requestStructPointer->requestMethodString = urlRequestInfo.requestMethod();
+ requestStructPointer->resourceTypeInt = urlRequestInfo.resourceType();
+ requestStructPointer->urlString = urlRequestInfo.requestUrl().toString();
+ requestStructPointer->webPageUrlString = urlRequestInfo.firstPartyUrl().toString();
+
+ // Check the filter lists.
+ bool continueProcessing = globalFilterListHelperPointer->checkFilterLists(urlRequestInfo, requestStructPointer);
+
+ // Further process the request if it hasn't already been handled.
+ if (continueProcessing) {
+ // Handle the request according to the resource type.
+ switch (urlRequestInfo.resourceType())