asarfuckery/electronasar/canary/browser/api/browser-view.js
2019-08-13 20:47:11 +02:00

13 lines
No EOL
464 B
JavaScript

'use strict';
const { EventEmitter } = require('events');
const { BrowserView } = process.electronBinding('browser_view');
Object.setPrototypeOf(BrowserView.prototype, EventEmitter.prototype);
BrowserView.fromWebContents = (webContents) => {
for (const view of BrowserView.getAllViews()) {
if (view.webContents.equal(webContents))
return view;
}
return null;
};
module.exports = BrowserView;
//# sourceMappingURL=browser-view.js.map