Is there any API provided by Electron to let get the current opened BrowserWindow count?
I did not find the method via the app API. Or can I get how many renderProcess is running now?
Is there any API provided by Electron to let get the current opened BrowserWindow count?
I did not find the method via the app API. Or can I get how many renderProcess is running now?
You can use BrowserWindow.getAllWindows and use isVisible per instance optionally:
let count = BrowserWindow.getAllWindows()
.filter(b => {
return b.isVisible()
})
.length
For number of renderer processes (which is not necessarily the same as BrowserWindow count) you can use webContents.getAllWebContents()