Electron: How can I get the BrowserWindow id from a renderer process?

Created on 14 Mar 2016  路  3Comments  路  Source: electron/electron

Is this information somehow encoded in the renderer process?

Most helpful comment

Have you try this ?
require('electron').remote.getCurrentWindow().id

All 3 comments

Have you try this ?
require('electron').remote.getCurrentWindow().id

@abdihaikal Cheers, I missed that from the docs :)

Since Electron now has more things than 2 years ago, you can just go over the event of your IPC call and request the BrowserWindow that triggered the call:

event.sender.getOwnerBrowserWindow() has that. It returns a BrowserWindow Object with all the properties that it could have such: minimize(), close(), etc....

Was this page helpful?
0 / 5 - 0 ratings

Related issues

diracdeltas picture diracdeltas  路  3Comments

EladBezalel picture EladBezalel  路  3Comments

chonsser picture chonsser  路  3Comments

DanielDignam picture DanielDignam  路  3Comments

reggi picture reggi  路  3Comments