I have tried both builder and packager, after building the top menu is available which allows access to developer tools..how do I get rid of it?
Asked
Active
Viewed 2,687 times
3
-
if you don't want the menu you have to setup your browserWindow to disable it for ex: mainWindow.setMenu(null); But you still have to detect if you are in prod or in test.Personnally I have a config.ini where I put information to open Devtools or not and don't use the menu but only doing mainWindow.openDevTools(); when my config.ini tell me to do it?. – Alain BUFERNE Aug 12 '20 at 09:59
1 Answers
5
If I've understood well you want to get rid of DevTools and the Menu bar
To disable DevTools you have to add webPreferences.devTools = false
to all your Windows as shown here:
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
// Your window configuration
webPreferences: {
devTools: false // This will disable dev tools
}
});
If you do this even by going to Menu > View > Toggle Developer Tools
the DevTools panel won't show up
And to get rid of the Menubar:
app.dock.hide(); // Only mac
mainWindow.setMenuBarVisibility(false); // Only Windows and Linux
// Or you can also use mainWindow.setMenu(null); on Windows and Linux
Everything on the main process

Autumn
- 325
- 3
- 13