From 75b6788937d383ae3bee3062f37e3e1ae9626118 Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Tue, 26 Apr 2022 20:21:45 +0800 Subject: [PATCH] opt: add javascript clipboard support --- articleview.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/articleview.cc b/articleview.cc index c96d198f..f0215328 100644 --- a/articleview.cc +++ b/articleview.cc @@ -320,15 +320,17 @@ ArticleView::ArticleView( QWidget * parent, ArticleNetworkAccessManager & nm, Au #if( QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) ) settings->defaultSettings()->setAttribute( QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, true ); settings->defaultSettings()->setAttribute( QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, true ); - settings->defaultSettings()->setAttribute( QWebEngineSettings::WebAttribute::ErrorPageEnabled, false); - settings->defaultSettings()->setAttribute(QWebEngineSettings::PluginsEnabled, cfg.preferences.enableWebPlugins); - settings->defaultSettings()->setAttribute(QWebEngineSettings::PlaybackRequiresUserGesture, false); + settings->defaultSettings()->setAttribute( QWebEngineSettings::WebAttribute::ErrorPageEnabled, false ); + settings->defaultSettings()->setAttribute( QWebEngineSettings::PluginsEnabled, cfg.preferences.enableWebPlugins ); + settings->defaultSettings()->setAttribute( QWebEngineSettings::PlaybackRequiresUserGesture, false ); + settings->defaultSettings()->setAttribute( QWebEngineSettings::JavascriptCanAccessClipboard, true ); #else settings->setAttribute( QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, true ); settings->setAttribute( QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, true ); settings->setAttribute( QWebEngineSettings::WebAttribute::ErrorPageEnabled, false ); settings->setAttribute( QWebEngineSettings::PluginsEnabled, cfg.preferences.enableWebPlugins ); settings->setAttribute( QWebEngineSettings::PlaybackRequiresUserGesture, false ); + settings->setAttribute( QWebEngineSettings::JavascriptCanAccessClipboard, true ); #endif // Load the default blank page instantly, so there would be no flicker.