0
votes

I'm using Electron for a Desktop Application. I'd liked to open a different Window by a button on main window (index.html).

Therefore, I found BrowserWindow from the Electron API. But I'm totally new in Electron, and I try to get to know the whole Framework.

I have a "a"-link Tag on main window, which is my button. This should open a new defined Electron Window. Maybe by an onclick event?

If the new opened window is closed, on main window a defined Javascript Event like (reload();) should triggered.

So my question is. How is the best way to open a Window and how can i "log" in main window, when the new window is closed an fire my JS-Event.

Thanks

1
Have you looked at this? - David Gomes

1 Answers

0
votes

This might help you. It'll execute javascript on your Main Window when the New Window is closed.

newWindow.on('closed', function(e){
        mainWindow.webContents.executeJavaScript(`alert("test");`);
})