[Feature Request] WebView2 embedded browser
See original GitHub issueIs your feature request related to a problem? Please describe.
On the desktop, an embedded browser only exists on .net45 and it is using an old version of Internet Explorer.
We need an embedded browser that:
- also work on .Net Core on Windows
- uses Edge as the actual engine (Edge is needed to satisfy the Fido scenario)
This browser is WebView2.
Stream of work:
-
Refactor current WebBrowser implementation to extract out marshalling to UI thread and maybe hosting in a panel
-
Add a WebView2 implementation of embedded browser on .NET Fx and .NET 5 https://docs.microsoft.com/en-us/microsoft-edge/webview2/gettingstarted/win32. Currently thinking it should go in the box with .NET Fx.
-
Change the WebUiFactory to prefer WebView2 if it is installed
-
Docs and log messages to tell ppl how to install WebView2
-
(Stretch goal) Add an
WithEmbeddedWebViewOptions
to MSAL that exposes an enum stating “PreferredBrowser” with values - Auto (default) - which means automatic fallback to WebBrowser, WebView2, LegacyWebBrowser. -
(Stretch goal) Change MSAL.Desktop to add support for WebView2 on .net core 3.1. We should have 1 method that pull in all the MSAL.Desktop functionality, smth like
.WithDesktopFeatures()
-
Goal for MSAL 5 - review the default browser selection. For example for B2C we should no longer allow LegacyWebBrowser as it is unusable.
@henrik-me @jmprieur to review the stretch goals.
Technical aspects:
You can use GetAvailableCoreWebView2BrowserVersionString/CoreWebView2Environment.GetAvailableBrowserVersionString to detect if a compatible version of the browser or runtime is installed.] How can we disable: o The context menu CoreWebView2Settings.AreDefaultContextMenusEnabled] o The developer tools (F12) CoreWebView2Settings.AreDevToolsEnabled] o The go back / go forward keys I don’t think we have a way to do this one.]
Is there an equivalent to WebBrowser.DocumentTitleChanged and WebBrowser.Title ? [davris: Yes DocumentTitle and DocumentTitleChanged]
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:31 (21 by maintainers)
Top GitHub Comments
WebView2 has GA-ed. Let’s try to use it in 4.24
Deliverable 1: Edge on Windows (by copying the .net classic implementation into the extension library) Deliverable 2: (needs a spike) Edge Chromium on Windows via webview2 Deliverable 3: (needs a spike) Support for Mac and Linux via https://github.com/SteveSandersonMS/WebWindow (thanks @mjcheetham )
I think this work item covers deliverable 1. Personally I would spike deliverable 3 directly before 2.