webview - Electron :为什么BrowserView比Webview具有更好的性能?

标签 webview electron webengine

我读过有关Webview和BrowserView的文章,它们似乎做同样的事情:将其他Web内容嵌入到应用程序中。我知道Electron的webview标签基于Chromium的webview,并且该API是不推荐使用的Chrome Apps平台的一部分。甚至Electron都建议不要使用Webview并考虑替代方法(iframe,BrowserView)。
但是,哪些更改使BrowserView更具优势?我知道,与Webview不同,BrowserView不使用其他渲染器进程,这就是为什么BrowserView具有更好的性能?其他指标是什么? BrowserView在内部与Webview有何不同?

最佳答案

这绝不是一个完整的答案,但由于BrowserView遇到各种问题,因此创建了webview
Here's创建者的博客文章:

  • a new way to embed web apps with fewer bugs and improved performance
  • webviews seemed to work well at first, but over time we ran into an ever growing list of issues. There were bugs in fundamental features like drag-and-drop and general performance was simply not on par with Chrome.

Electron的 webview documentation说:

Electron's webview tag is based on Chromium's webview, which is undergoing dramatic architectural changes. This impacts the stability of webviews, including rendering, navigation, and event routing.


一天中有许多webview bugs,尽管这些特定的似乎是固定的。
Here's关于BrowserView的命运的问题,维护者说:

<webview> still has a number of bugs. There are also architectural issues like slow auto-resizing that are unlikely to be fixed in Chromium any time soon


Here是许多webview错误(尽管您当然也可以找到BrowserView的错误)
另外,您说:

the BrowserView does not use another renderer process


我相信我也在某个地方也看到了对此的提及,但是我认为那不是真的。
BrowserView导航到页面后,将为其创建一个新的渲染器进程。
更新:哦,我想这意味着webview == 1进程和BrowserView == 1进程,但是您在另一个Renderer进程内部创建了webview,而在主进程内部创建了BrowserView。因此,使用webview会有一个额外的过程。

关于webview - Electron :为什么BrowserView比Webview具有更好的性能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66493829/

相关文章:

java - 如何在 epub 页面中创建分页?安卓

java - 无法在 onReceivedError() 中加载新的 WebView

iOS Swift WKWebView 不缩放

iphone - UIWebview 加载安全页面缓慢

html - 打开 DevTools 时,Electron BrowserWindow 切换到暗模式

mysql - 在 WINDOWS、Linux、macOS 上自动安装 MySQL

javascript - 使用 request-promise 在 Electron 中链接 HTTP 请求

java - 无法在 JavaFX WebView 中登录 Google