From 43e5541e8033b9405b8ea62b72710855d489ae89 Mon Sep 17 00:00:00 2001 From: Brian Clifton Date: Tue, 16 May 2017 11:30:13 -0700 Subject: [PATCH] Revert "Remove old copy hack for macOS packaged builds" This reverts commit 26afbd557d0ba6b005142264a86f00404161932b. --- app/localShortcuts.js | 9 +++++++++ js/constants/messages.js | 1 + js/stores/windowStore.js | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/localShortcuts.js b/app/localShortcuts.js index 2f12a0fa329..1255f8e77b2 100644 --- a/app/localShortcuts.js +++ b/app/localShortcuts.js @@ -45,6 +45,15 @@ module.exports.register = (win) => { simpleWebContentEvents.push( ['Cmd+Alt+U', messages.SHORTCUT_ACTIVE_FRAME_VIEW_SOURCE] ) + + if (process.env.NODE_ENV !== 'development') { + // We're in Darwin and release or test mode... + // We disable for development mode because Browser level dev tools copy doesn't work. + // Workaround for #1060 + simpleWebContentEvents.push( + ['Cmd+C', messages.SHORTCUT_ACTIVE_FRAME_COPY] + ) + } } // Tab ordering shortcuts diff --git a/js/constants/messages.js b/js/constants/messages.js index 6df5cd1454f..e8eb61d9984 100644 --- a/js/constants/messages.js +++ b/js/constants/messages.js @@ -26,6 +26,7 @@ const messages = { SHORTCUT_ACTIVE_FRAME_FORWARD: _, SHORTCUT_ACTIVE_FRAME_BOOKMARK: _, SHORTCUT_ACTIVE_FRAME_REMOVE_BOOKMARK: _, + SHORTCUT_ACTIVE_FRAME_COPY: _, SHORTCUT_ACTIVE_FRAME_FIND_NEXT: _, SHORTCUT_ACTIVE_FRAME_FIND_PREV: _, // Frame management shortcuts diff --git a/js/stores/windowStore.js b/js/stores/windowStore.js index a33ec48f5f2..8e4760d240c 100644 --- a/js/stores/windowStore.js +++ b/js/stores/windowStore.js @@ -767,7 +767,7 @@ ipc.on(messages.SHORTCUT_OPEN_CLEAR_BROWSING_DATA_PANEL, (e) => { }) }) -const frameShortcuts = ['stop', 'reload', 'zoom-in', 'zoom-out', 'zoom-reset', 'toggle-dev-tools', 'clean-reload', 'view-source', 'mute', 'save', 'print', 'show-findbar', 'find-next', 'find-prev'] +const frameShortcuts = ['stop', 'reload', 'zoom-in', 'zoom-out', 'zoom-reset', 'toggle-dev-tools', 'clean-reload', 'view-source', 'mute', 'save', 'print', 'show-findbar', 'copy', 'find-next', 'find-prev'] frameShortcuts.forEach((shortcut) => { // Listen for actions on the active frame ipc.on(`shortcut-active-frame-${shortcut}`, (e, args) => {