diff options
author | Kai Koehne <kai.koehne@qt.io> | 2017-10-26 15:11:20 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2018-02-02 09:57:01 +0000 |
commit | 0cc07329495a05fc5f8532c4420bd23db662fdb6 (patch) | |
tree | 6dc317f9509ed71304e57051e6da85ca66f1a072 /src/core/web_engine_settings.cpp | |
parent | 28c9385ab3568361a53a4ea1559c1b971a44d50d (diff) |
Expose JavascriptCanPaste attribute
Expose an attribute to enable the execCommand("paste") functionality,
which is by default disabled due to security concerns.
[ChangeLog][General] Added JavaScriptCanPaste attribute that
enables JavaScript 'execCommand("paste")'.
Task-number: QTBUG-64056
Change-Id: I1a414021e020473dd15946fff91fb103d871e961
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_engine_settings.cpp')
-rw-r--r-- | src/core/web_engine_settings.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp index f438091c6..b2b89c78d 100644 --- a/src/core/web_engine_settings.cpp +++ b/src/core/web_engine_settings.cpp @@ -297,6 +297,7 @@ void WebEngineSettings::initDefaults() playbackRequiresUserGesture = (commandLine->GetSwitchValueASCII(switches::kAutoplayPolicy) != switches::autoplay::kNoUserGestureRequiredPolicy); s_defaultAttributes.insert(PlaybackRequiresUserGesture, playbackRequiresUserGesture); s_defaultAttributes.insert(WebRTCPublicInterfacesOnly, false); + s_defaultAttributes.insert(JavascriptCanPaste, false); } if (s_defaultFontFamilies.isEmpty()) { @@ -388,6 +389,7 @@ void WebEngineSettings::applySettingsToWebPreferences(content::WebPreferences *p ? content::AutoplayPolicy::kUserGestureRequired : content::AutoplayPolicy::kNoUserGestureRequired; } + prefs->dom_paste_enabled = testAttribute(JavascriptCanPaste); // Fonts settings. prefs->standard_font_family_map[content::kCommonScript] = toString16(fontFamily(StandardFont)); |