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

nikolowry picture nikolowry  路  100Comments

GregorBiswanger picture GregorBiswanger  路  122Comments

alexeykuzmin picture alexeykuzmin  路  133Comments

thomasdao picture thomasdao  路  144Comments

LoganDark picture LoganDark  路  110Comments