🔧 Add BrowserWindow.fromBrowserView()

This commit is contained in:
Felix Rieseberg 2017-11-22 14:36:54 -08:00
parent fded32dc4f
commit 8c5aad8b17

View file

@ -144,6 +144,12 @@ BrowserWindow.fromWebContents = (webContents) => {
}
}
BrowserWindow.fromBrowserView = (browserView) => {
for (const window of BrowserWindow.getAllWindows()) {
if (window.getBrowserView() === browserView) return window
}
}
BrowserWindow.fromDevToolsWebContents = (webContents) => {
for (const window of BrowserWindow.getAllWindows()) {
const {devToolsWebContents} = window