Is it possible to disable


webContents.openDevTools() in Electron app

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

Is it possible?


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.


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.


Yes, with event.preventDefault()
catch the keypress by adding
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


@tungsten ok thanks.

Here is another idea I ran into in this tutorial:

It overrides the shortcut with the Electron module GlobalShortcut: