electron/lib/browser/api/browser-view.js
Felix Rieseberg 037f76c47b 🐛 Ooops, fix that
2017-11-22 17:07:57 -08:00

16 lines
391 B
JavaScript

'use strict'
const {EventEmitter} = require('events')
const {BrowserView} = process.atomBinding('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