+ // Handle the request according to the resource type.
+ switch (urlRequestInfo.resourceType())
+ {
+ // A naughty HTTP ping request.
+ case QWebEngineUrlRequestInfo::ResourceTypePing:
+ {
+ // Block the HTTP ping request.
+ urlRequestInfo.block(true);
+
+ // Display the HTTP Ping blocked dialog.
+ emit displayHttpPingDialog(urlRequestInfo.requestUrl().toString());
+
+ break;
+ }
+
+ default:
+ {
+ // Do nothing.
+ break;
+ }
+ }
+