语言
Iframes in Electron behave like iframes in regular browsers. An <iframe>
element in your page can show external web pages, provided that their Content Security Policy allows it. To limit the amount of capabilities a site in an <iframe>
tag, it’s recommended to use the and only allow the capabilities you want to support.
WebViews are a custom element (<webview>
) that will only work inside Electron. They are implemented as an “out-of-process iframe”. This means that all communication with the is done asynchronously using IPC. The <webview>
element has many custom methods and events, similar to webContents
, that allow you much greater control over the contents.
BrowserViews are not part of the DOM - instead, they are created in and controlled by your main process. They are simply another layer of web content on top of your existing window. This means that they are completely separate from your own BrowserWindow
content and that their position is not controlled by the DOM or CSS but by setting the bounds in the main process.