0
votes

I'm using electron with multiple browserWindows. in this browserWindow I do have a webview where the content is shown. Now I wat to send a new url to the webview of the other open browserWindow.

So I created a ipc listener in all of the browserwindows / webviews to update the url if a request is received. this is working fine so far. Only what I can't get working is to focus/show the window with the new url.

I've tried to find a way to get the browserWindow instance for a webview, but that seems impossible...

How can I show/focus a window on receiving a message via IPC? Thanks!

1

1 Answers

0
votes

You can get the instance of the current BrowserWindow pretty easy:

const remote = require('electron').remote    
const win = remote.getCurrentWindow()

Use win.focus() to bring that window the front.