Last active
October 31, 2019 07:44
-
-
Save ozrabal/da338602fb3cef5a0edb640c87c9977b to your computer and use it in GitHub Desktop.
Add shortcut to open devtools in electron app on production #electron
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { remote } from 'electron' | |
remote.globalShortcut.register('CommandOrControl+Shift+K', () => { | |
remote.BrowserWindow.getFocusedWindow().webContents.openDevTools() | |
}) | |
window.addEventListener('beforeunload', () => { | |
remote.globalShortcut.unregisterAll() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment