Skip to content

Instantly share code, notes, and snippets.

@ozrabal
Last active October 31, 2019 07:44
Show Gist options
  • Save ozrabal/da338602fb3cef5a0edb640c87c9977b to your computer and use it in GitHub Desktop.
Save ozrabal/da338602fb3cef5a0edb640c87c9977b to your computer and use it in GitHub Desktop.
Add shortcut to open devtools in electron app on production #electron
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