8b9f7e5b00
Right now, `<webview>` is the only way to embed additional content in a `BrowserWindow`. Unfortunately `<webview>` suffers from a [number of problems](https://github.com/electron/electron/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3Awebview%20). To make matters worse, many of these are upstream Chromium bugs instead of Electron-specific bugs. For us at [Figma](https://www.figma.com), the main issue is very slow performance. Despite the upstream improvements to `<webview>` through the OOPIF work, it is probable that there will continue to be `<webview>`-specific bugs in the future. Therefore, this introduces a `<webview>` alternative to called `BrowserView`, which... - is a thin wrapper around `api::WebContents` (so bugs in `BrowserView` will likely also be bugs in `BrowserWindow` web contents) - is instantiated in the main process like `BrowserWindow` (and unlike `<webview>`, which lives in the DOM of a `BrowserWindow` web contents) - needs to be added to a `BrowserWindow` to display something on the screen This implements the most basic API. The API is expected to evolve and change in the near future and has consequently been marked as experimental. Please do not use this API in production unless you are prepared to deal with breaking changes. In the future, we will want to change the API to support multiple `BrowserView`s per window. We will also want to consider z-ordering auto-resizing, and possibly even nested views. |
||
---|---|---|
.. | ||
api | ||
development | ||
tutorial | ||
faq.md | ||
glossary.md | ||
README.md | ||
styleguide.md |
Please make sure that you use the documents that match your Electron version. The version number should be a part of the page URL. If it's not, you are probably using the documentation of a development branch which may contain API changes that are not compatible with your Electron version. To view older versions of the documentation, you can browse by tag on GitHub by opening the "Switch branches/tags" dropdown and selecting the tag that matches your version.
FAQ
There are questions that are asked quite often. Check this out before creating an issue:
Guides
- Glossary of Terms
- Supported Platforms
- Security
- Electron Versioning
- Application Distribution
- Mac App Store Submission Guide
- Windows Store Guide
- Application Packaging
- Using Native Node Modules
- Debugging Main Process
- Using Selenium and WebDriver
- DevTools Extension
- Using Pepper Flash Plugin
- Using Widevine CDM Plugin
- Testing on Headless CI Systems (Travis, Jenkins)
- Offscreen Rendering
- Keyboard Shortcuts
Tutorials
API References
Custom DOM Elements:
Modules for the Main Process:
- app
- autoUpdater
- BrowserWindow
- contentTracing
- dialog
- globalShortcut
- ipcMain
- Menu
- MenuItem
- net
- powerMonitor
- powerSaveBlocker
- protocol
- session
- systemPreferences
- Tray
- webContents
Modules for the Renderer Process (Web Page):
Modules for Both Processes:
Development
- Coding Style
- Using clang-format on C++ Code
- Source Code Directory Structure
- Technical Differences to NW.js (formerly node-webkit)
- Build System Overview
- Build Instructions (macOS)
- Build Instructions (Windows)
- Build Instructions (Linux)
- Debug Instructions (macOS)
- Debug Instructions (Windows)
- Setting Up Symbol Server in debugger
- Documentation Styleguide
- Upgrading Chrome
- Chromium Development
- V8 Development