BrowserView
History
| Version(s) | Changes |
|---|---|
>=29.0.0 | API DEPRECATED |
note
The BrowserView class is deprecated, and replaced by the new
WebContentsView class.
A BrowserView can be used to embed additional web content into a
BrowserWindow. It is like a child window, except that it is positioned
relative to its owning window. It is meant to be an alternative to the
webview tag.
Class: BrowserView
History
| Version(s) | Changes |
|---|---|
>=29.0.0 | API DEPRECATED |
Create and control views.
note
The BrowserView class is deprecated, and replaced by the new
WebContentsView class.
Process: Main
This module cannot be used until the ready event of the app
module is emitted.
warning
Electron's built-in classes cannot be subclassed in user code. For more information, see the FAQ.
Example
// In the main process.
const { app, BrowserView, BrowserWindow } = require('electron')
app.whenReady().then(() => {
const win = new BrowserWindow({ width: 800, height: 600 })
const view = new BrowserView()
win.setBrowserView(view)
view.setBounds({ x: 0, y: 0, width: 300, height: 300 })
view.webContents.loadURL('https://electronjs.org')
})
new BrowserView([options]) Experimental Deprecated
History
| Version(s) | Changes |
|---|---|
>=29.0.0 | API DEPRECATED |