I'm trying to keep my electron app from being able to start more than one window at a time. I've already tried this, but it makes the first window opened close itself instead of the second window opened, and it completely stops working for the third window:
app.requestSingleInstanceLock();
app.on('second-instance', () => {
app.quit();
});
Run Code Online (Sandbox Code Playgroud)
The older app.makeSingleInstance also throws an error since it's deprecated. What should I do instead?