Merge pull request #11224 from electron/browser-view-window
feature: Add `BrowserWindow.fromBrowserView()`
This commit is contained in:
commit
9c217fc6c7
3 changed files with 38 additions and 1 deletions
|
@ -144,6 +144,14 @@ BrowserWindow.fromWebContents = (webContents) => {
|
|||
}
|
||||
}
|
||||
|
||||
BrowserWindow.fromBrowserView = (browserView) => {
|
||||
for (const window of BrowserWindow.getAllWindows()) {
|
||||
if (window.getBrowserView() === browserView) return window
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
BrowserWindow.fromDevToolsWebContents = (webContents) => {
|
||||
for (const window of BrowserWindow.getAllWindows()) {
|
||||
const {devToolsWebContents} = window
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue