Skip to content

[Feature Request] WebView2 embedded browser  #1398

@jmprieur

Description

@jmprieur

Is 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]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions