question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] WebView2 embedded browser

See original GitHub issue

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]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:31 (21 by maintainers)

github_iconTop GitHub Comments

4reactions
bgavrilMScommented, Nov 23, 2020

WebView2 has GA-ed. Let’s try to use it in 4.24

3reactions
bgavrilMScommented, Apr 9, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overview of WebView2 features and APIs
Embed web content into native applications. Communicate between native code and web code using simple messages, JavaScript code, and native ...
Read more >
Introduction to Microsoft Edge WebView2
The Microsoft Edge WebView2 control allows you to embed web technologies (HTML, CSS, and JavaScript) in your native apps.
Read more >
Solved: Modern embedded web browser - NI Community
NI allows anyone to make feature requests such as this by opening an official "service request" through the web site's support tab. It...
Read more >
Choosing between DotNetBrowser and WebView2 | Blog
This article clarifies the difference between DotNetBrowser and WebView2 and argues that DotNetBrowser is better for commercial use.
Read more >
Try out WebView2 with the new interactive API sample
A WebView is a modal that is embedded within a native application, and which renders web content (HTML/CSS/JavaScript) powered by the browser.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found