How to prevent automatic opening of devtool upon app launch


#1

It started a few weeks ago, that when I launched the electron app it will also open the devtool automatically.

I need the devtool but I don’t want that on every window I open it also open another window of devtool.

is there a way how I can prevent that?

Thanks


#2

In the options attribute for the BrowserWindow constructor, set webPreferences.devTools to false. That means you won’t ever be able to open the dev tools on those windows, but that’s the way it works. I’d look in the code you have to make sure you don’t have some function calling openDevTools() when you don’t want it to.