mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
opt:whitelist add .gif resource
This commit is contained in:
parent
ceb4a00d2e
commit
3c0d694c43
4
utils.hh
4
utils.hh
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue