Skip to content

Instantly share code, notes, and snippets.

@jaredjburgess
Created May 4, 2016 22:44
Show Gist options
  • Save jaredjburgess/56a60008ea7fba45d07a9a08ce8b57fe to your computer and use it in GitHub Desktop.
Save jaredjburgess/56a60008ea7fba45d07a9a08ce8b57fe to your computer and use it in GitHub Desktop.
The item that needs to be added to the array that is passed to the Menu.buildFromTemplate electron function. This gives you dev tools in a menu in the tray.
{
label: 'View',
submenu: [
{
label: 'Toggle Developer Tools',
accelerator: (function() {
if (process.platform == 'darwin')
return 'Alt+Command+I';
else
return 'Ctrl+Shift+I';
})(),
click: function(item, focusedWindow) {
if (focusedWindow)
focusedWindow.webContents.toggleDevTools();
}
}
]
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment