add QWebEngineSettings::UnknownUrlSchemePolicy to qwebenginesettings

This commit is contained in:
xiaoyifang 2022-03-14 23:24:53 +08:00
parent 3a50805cea
commit 61fb1020b8

View file

@ -336,6 +336,7 @@ ArticleView::ArticleView( QWidget * parent, ArticleNetworkAccessManager & nm, Au
ui.ftsSearchFrame->installEventFilter( this ); ui.ftsSearchFrame->installEventFilter( this );
QWebEngineSettings * settings = ui.definition->settings(); QWebEngineSettings * settings = ui.definition->settings();
settings->setUnknownUrlSchemePolicy(QWebEngineSettings::UnknownUrlSchemePolicy::DisallowUnknownUrlSchemes);
#if( QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) ) #if( QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) )
settings->defaultSettings()->setAttribute( QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, true ); settings->defaultSettings()->setAttribute( QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, true );
settings->defaultSettings()->setAttribute( QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, true ); settings->defaultSettings()->setAttribute( QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, true );