Main.js External function call from a.js script file


Created two window using single main.js …second window will open only if first window function value is
valid. So I have to put condition before second window opens. What do i do?


Create a new BrowserWindow with show as false:

secondWindow = new BrowserWindow({
    show: false

not sure how to get hold of the condition is true, but do something like this :

if(myCondition) {


Came to think about that you can probably use ipcRenderer.send() from the first window and then listen to that event in main.js, and when fired use


I just wrote a tutorial on this topic. If you still need it, or anyone else comes across this thread you can follow the steps here: