fix: BrowserWindow.fromBrowserView in multiple-BrowserView windows (#26493)

This commit is contained in:
Jeremy Rose
2020-11-17 11:12:02 -08:00
committed by GitHub
parent 040ee66678
commit 7c2ac6b7c1
2 changed files with 18 additions and 6 deletions

View File

@@ -96,11 +96,7 @@ BrowserWindow.fromWebContents = (webContents: WebContents) => {
};
BrowserWindow.fromBrowserView = (browserView: BrowserView) => {
for (const window of BrowserWindow.getAllWindows()) {
if (window.getBrowserView() === browserView) return window;
}
return null;
return BrowserWindow.fromWebContents(browserView.webContents);
};
BrowserWindow.prototype.setTouchBar = function (touchBar) {