mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
fix: iframe should let the url passthrough if the url's baseHost matches with the iframe's baseHost
This commit is contained in:
parent
7bc00750d2
commit
e8c550e20a
|
@ -11,7 +11,8 @@ WebUrlRequestInterceptor::WebUrlRequestInterceptor(QObject *p)
|
||||||
void WebUrlRequestInterceptor::interceptRequest( QWebEngineUrlRequestInfo &info) {
|
void WebUrlRequestInterceptor::interceptRequest( QWebEngineUrlRequestInfo &info) {
|
||||||
if( Utils::isExternalLink( info.requestUrl() ) )
|
if( Utils::isExternalLink( info.requestUrl() ) )
|
||||||
{
|
{
|
||||||
if(GlobalBroadcaster::instance()-> existedInWhitelist(info.requestUrl().host()))
|
auto hostBase = getHostBase( info.requestUrl().host() );
|
||||||
|
if( GlobalBroadcaster::instance()->existedInWhitelist( hostBase ) )
|
||||||
{
|
{
|
||||||
//whitelist url does not block
|
//whitelist url does not block
|
||||||
return;
|
return;
|
||||||
|
@ -20,8 +21,13 @@ void WebUrlRequestInterceptor::interceptRequest( QWebEngineUrlRequestInfo &info)
|
||||||
//let throuth the resources file.
|
//let throuth the resources file.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// configure should the gd block external links
|
||||||
|
// if( GlobalBroadcaster::instance()->getPreference()->disallowContentFromOtherSites )
|
||||||
|
{
|
||||||
info.block( true );
|
info.block( true );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (QWebEngineUrlRequestInfo::NavigationTypeLink == info.navigationType() && info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMainFrame) {
|
if (QWebEngineUrlRequestInfo::NavigationTypeLink == info.navigationType() && info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMainFrame) {
|
||||||
//workaround to fix devtool "Switch devtool to chinese" interface was blocked.
|
//workaround to fix devtool "Switch devtool to chinese" interface was blocked.
|
||||||
|
|
Loading…
Reference in a new issue