Is it possible to disable


#1

webContents.openDevTools() in Electron app

I don’t want the users to type CTRL-SHIFT-I to open the dev tools.

Is it possible?


#2

You can override the default menu with whatever you want. Also I think you can simply omit the menu completely and when you package your application the default menu items (open dev tools, etc) won’t show up at all.


#3

yes but the shortcut CTRL-SHIFT-I will open the dev tools without a menu item. I would like to omit that capability entirely in the production release.


#4

Yes, with event.preventDefault()
catch the keypress by adding
onkeydown="KeyDownFn(event)"
in the body tag of your index.html

then add this function:
function KeyDownFn(evt) {
if (evt.keyCode == 73 && evt.ctrlKey && evt.shiftKey) evt.preventDefault();
}
it prevents Ctrl+Shift+I only


#5

@tungsten ok thanks.

Here is another idea I ran into in this tutorial: https://medium.com/developers-writing/building-a-desktop-application-with-electron-204203eeb658#.fm84wbsbi

It overrides the shortcut with the Electron module GlobalShortcut: http://electron.atom.io/docs/v0.37.3/api/global-shortcut/