refactor: ginify BrowserView (#23578)

This commit is contained in:
Jeremy Rose 2020-07-09 08:48:39 -07:00 committed by GitHub
parent 66d65a6d35
commit 9bd0fc5348
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 128 additions and 165 deletions

View file

@ -1,15 +1,3 @@
import { EventEmitter } from 'events';
const { BrowserView } = process._linkedBinding('electron_browser_browser_view');
Object.setPrototypeOf(BrowserView.prototype, EventEmitter.prototype);
BrowserView.fromWebContents = (webContents: Electron.WebContents) => {
for (const view of BrowserView.getAllViews()) {
if (view.webContents.equal(webContents)) return view;
}
return null;
};
export default BrowserView;