diff options
author | 2022-06-15 14:45:05 +0100 | |
---|---|---|
committer | 2022-06-15 14:45:05 +0100 | |
commit | 6757907ab78ee1d1d49e6a1917119b816789096a (patch) | |
tree | 01cf1ce2e5415d730dd794c6604c9bcf82aacebb /src | |
parent | Lock snapcraft to v5 since v7 breaks the build (diff) | |
download | ferdium-app-6757907ab78ee1d1d49e6a1917119b816789096a.tar.gz ferdium-app-6757907ab78ee1d1d49e6a1917119b816789096a.tar.zst ferdium-app-6757907ab78ee1d1d49e6a1917119b816789096a.zip |
Fix Developer Tools won't show up via menu (#264)
Fix #260 following Franz approach
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Menu.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 28de1f1c8..50145dd47 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -3,6 +3,7 @@ import { | |||
3 | app, | 3 | app, |
4 | Menu, | 4 | Menu, |
5 | dialog, | 5 | dialog, |
6 | webContents, | ||
6 | systemPreferences, | 7 | systemPreferences, |
7 | getCurrentWindow, | 8 | getCurrentWindow, |
8 | } from '@electron/remote'; | 9 | } from '@electron/remote'; |
@@ -622,8 +623,15 @@ class FranzMenu { | |||
622 | { | 623 | { |
623 | label: intl.formatMessage(menuItems.toggleDevTools), | 624 | label: intl.formatMessage(menuItems.toggleDevTools), |
624 | accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+I`, | 625 | accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+I`, |
625 | click: (menuItem, browserWindow) => { | 626 | click: () => { |
626 | browserWindow.webContents.toggleDevTools(); | 627 | const windowWebContents = webContents.fromId(1); |
628 | const { isDevToolsOpened, openDevTools, closeDevTools } = windowWebContents; | ||
629 | |||
630 | if (isDevToolsOpened()) { | ||
631 | closeDevTools(); | ||
632 | } else { | ||
633 | openDevTools({ mode: 'right' }); | ||
634 | } | ||
627 | }, | 635 | }, |
628 | }, | 636 | }, |
629 | { | 637 | { |