Add new Microsoft Edge to web browser control?
UPDATE Jan 2021: WebView2 has been released. This enables integration of the Chromium based Edge as a web control. It's a lot more complicated to use, unfortunately, but a lot more powerful. Works with WinForms or WPF or C++ apps. https://docs.microsoft.com/en-us/microsoft-edge/webview2/
UPDATE May 2018: FINALLY Microsoft has made it easy. https://blogs.windows.com/msedgedev/2018/05/09/modern-webview-winforms-wpf-apps/
For now, the new control is in the Windows Community Toolkit 3.0 and contained in Toolkit.Win32.UI.Controls.dll, which you may need to manually add a reference to.
====== I wish somebody had mentioned this, so I'll add this because it doesn't look like webbrowser control will ever be updated.
Use the WebView control instead. This uses EdgeHTML rendering engine. This is part of WindowPresentation layer but it is possible to link from WinForms and presumably other apps. You must convert to a UWP app
import Windows.UI.Xaml.Controls.WebView
Example code: https://code.msdn.microsoft.com/windowsapps/XAML-WebView-control-sample-58ad63f7
I haven't replaced my WebBrowser with WebView yet, but the interface looks pretty familiar.
Unfortunately it seems that there is currently no way to use Edge in a MS webbrowser control without using third party addons. While the proposed "solution" to add dword:00002ee1 to FEATURE_BROWSER_EMULATION causes the webbrowser to (falsely) report Edge/12.9200_AGENT as USER_AGENT, in fact it still uses the Trident engine to render the web content. So it seems that Microsoft had planned to support Edge in webbrowser control but did not get finished and forgot to take out the corresponding Emulation key. You can verify this by browsing to http://html5test.com/ where the webbrowser control scores between 342 and 347 points (the same as IE11), while Edge scores 397 points.
UPDATE As stated in @MartinKasztantowicz' answer, as of now (mid Feb '16) there is no known way to load the real Edge rendering engine. The following sets the control to report the new user agent but uses the old engine for rendering. It is useful nevertheless for e.g. persuading sites to turn off deprecated IE hacks.
The browser version of System.Windows.Forms.WebBrowser
is controlled per application by a registry key. If your users are on Windows 10, you can tell the control to load fake Edge by adding the following key:
- For 64bit applications, 32bit only Windows or current user:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION] "Example.exe"=dword:00002ee1
respectively[HKEY_CURRENT_USER\...]
- For 32bit applications on 64 bit machines (only machine-wide):
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION] "Example.exe"=dword:00002ee1
For more information and values, check the corresponding Microsoft Documentation
I just tested, and got the following result... don't know whether there are any values to also report Windows 10: