opt:block url logic

This commit is contained in:
Xiao YiFang 2022-09-04 19:50:12 +08:00
parent 6e74c27ea2
commit e91cc9021c

View file

@ -21,7 +21,12 @@ void WebUrlRequestInterceptor::interceptRequest( QWebEngineUrlRequestInfo &info)
//whitelist url does not block
return;
}
if(Utils::isHtmlResources(info.requestUrl())){
if( info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeImage
|| info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeFontResource
|| info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeStylesheet
|| info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMedia
|| Utils::isHtmlResources( info.requestUrl() ) )
{
//let throuth the resources file.
return;
}