Skip to content

Proposal: A WebView based on Microsoft Edge (Chromium) in WinUI 3 #1658

Description

Proposal: A WebView based on Microsoft Edge (Chromium) in WinUI 3

Summary

The Microsoft Edge browser is moving to be based on the Chromium web engine. This proposal is to create a WebView in WinUI 3 which takes advantage of the Microsoft Edge Webview2. This will allow WinUI 3 apps to host web content in the most relevant and standards compliant way.

We have now released a preview of the control in WinUI 3.0 Alpha (February 2020) 🚀👩‍💻🎉

Rationale

  • The latest version of Microsoft Edge will be using Chromium and the current XAML WebView is based on the EdgeHTML engine
  • WinUI developers would have access to the web-compatible Chromium platform
  • The performance characteristics of web content in WinUI apps will begin to match that of Chromium
  • WinUI app developers have requested this feature

Scope

Capability Priority                          
Developers can host standards-based web content rendered by the Chromium engine in WinUI apps
Must
Support the Microsoft Edge 'evergreen' update model, keeping the WebView rendering up to date with the latest auto-update of Microsoft Edge on the users system Must
Released as an open source component in the WinUI repo Should
Developers can host web content in apps on all OS releases where WinUI 3 is supported Should
Gracious failure when WebView is run without Microsoft Edge (Chromium) installed Should
Smooth migration experience for current users of EdgeHTML Webview Should
Allow simple access to WinRT APIs via AddWebAllowedObject Should
Access to WinRT directly via JavaScript Could
(not in v1)
Ability to package a specific version of Microsoft Edge with the app, e.g. BYOV Could
(not in v1)

Proposed API

The WinUI WebView element will be built on top of the Microsoft Edge WebView2 API. We have yet to determine the full shape and set of APIs for the WebView element. A draft spec for the WebView2 has been posted to the spec repository.

APIs included in the API spec are those being proposed for the WinUI WebView element directly. Additional APIs will reside on the WebView2 core object. There are not represented in the API spec linked above.

In short; If you don't see an API in the WebView2 API spec and it is existing functionality of the current WebView, it is likely planned to be included on the base WinRT object, whose API is likely to closely match the current IWebView2WebView interface.

The high-level API structure is pictured below.

 _________________________
|                         |
|       WinUI 3 App       |
|_________________________|
|                         |
| WinUI WebView element   |
|          API            |
|_________________________|
|                         |
|   WebView2 core API     |
|                         |
|_________________________|

Metadata

Metadata

Labels

area-WebViewfeature proposalNew feature proposalneeds-winui-3Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions