Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit 696673f

Browse files
author
Marcel Gerber
authored
Merge pull request #567 from ficristo/paste
Enable paste command
2 parents ac6956f + d2b43f8 commit 696673f

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

appshell/cef_main_window.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ BOOL cef_main_window::HandleCreate()
226226

227227
settings.web_security = STATE_DISABLED;
228228

229+
// Necessary to enable document.executeCommand("paste")
230+
settings.javascript_access_clipboard = STATE_ENABLED;
231+
settings.javascript_dom_paste = STATE_ENABLED;
232+
229233
// Initialize window info to the defaults for a child window
230234
info.SetAsChild(mWnd, rect);
231235

appshell/cefclient_gtk.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ int main(int argc, char* argv[]) {
244244

245245
browserSettings.web_security = STATE_DISABLED;
246246

247+
// Necessary to enable document.executeCommand("paste")
248+
browserSettings.javascript_access_clipboard = STATE_ENABLED;
249+
browserSettings.javascript_dom_paste = STATE_ENABLED;
250+
247251
window_info.SetAsChild(vbox);
248252

249253
CefBrowserHost::CreateBrowser(

appshell/cefclient_mac.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,10 @@ - (void)createApp:(id)object {
682682

683683
settings.web_security = STATE_DISABLED;
684684

685+
// Necessary to enable document.executeCommand("paste")
686+
settings.javascript_access_clipboard = STATE_ENABLED;
687+
settings.javascript_dom_paste = STATE_ENABLED;
688+
685689
CefRefPtr<CefCommandLine> cmdLine = AppGetCommandLine();
686690

687691
#ifdef DARK_INITIAL_PAGE

0 commit comments

Comments
 (0)