opt:whitelist add .gif resource

This commit is contained in:
Xiao YiFang 2022-07-11 21:18:58 +08:00
parent ceb4a00d2e
commit 3c0d694c43
2 changed files with 3 additions and 3 deletions

View file

@ -84,10 +84,10 @@ inline bool isExternalLink(QUrl const &url) {
url.scheme() == "file" || url.toString().startsWith( "//" );
}
inline bool isCssFontImage(QUrl const &url) {
inline bool isHtmlResources(QUrl const &url) {
auto fileName = url.fileName();
auto ext=fileName.mid(fileName.lastIndexOf("."));
QStringList extensions{".css",".woff",".woff2","ttf",".bmp" ,".jpg", ".png", ".tif",".wav", ".ogg", ".oga", ".mp3", ".mp4", ".aac", ".flac",".mid", ".wv ",".ape"} ;
QStringList extensions{".css",".woff",".woff2","ttf",".bmp" ,".jpg", ".png",".gif", ".tif",".wav", ".ogg", ".oga", ".mp3", ".mp4", ".aac", ".flac",".mid", ".wv",".ape"} ;
return extensions.indexOf(ext)>-1;
}

View file

@ -21,7 +21,7 @@ void WebUrlRequestInterceptor::interceptRequest( QWebEngineUrlRequestInfo &info)
//whitelist url does not block
return;
}
if(Utils::isCssFontImage(info.requestUrl())){
if(Utils::isHtmlResources(info.requestUrl())){
//let throuth the resources file.
return;
}