/webview2-dotnetbrowser

A dot new web browser built with the Microsoft Edge WebView2 control.

Primary LanguageJavaScriptMIT LicenseMIT

webview2-dotnetbrowser

When Microsoft revealed their plans for a Chrome based Edge browser the first thing I thought was "I wonder if they are going to support an embedded web browser control"? Well sure enough they released WebView2 and I've been keeping an eye on the releases. Recently I found a great sample written by David Risney and I was inspired to take a shot at putting together a C# version.

This "port" is a dot net web browser built with

It is a sample Windows desktop application demonstrating the WebView2 control capabilities. It is built as a Windows Forms Visual Studio 2019 project and makes use of the WebView2 C++ toolkit, a C# interop and a custom windows forms control. JavaScript is used in the WebView2 environment to power its features.

Prerequisites

  • Microsoft Edge (Chromium) installed on a supported OS.
  • Visual Studio with C# desktop development support installed. Edge Version Canary or Dev channel is recommended for the installation and the minimum version is 80.0.320.5

Build the browser

Clone the repository and open the solution in Visual Studio. Microsoft.Web.WebView2, MtrDev.WebView2.Interop and MtrDev.WebView2.WinForms are already included as a NuGet packages* in the project!

  • Clone this repository
  • Open the solution in Visual Studio 2019 (2017 should also work)
  • Set the target you want to build
  • Build the solution

Functionality

For now check out the C++ sample readme while I find some time to modify it for this project.

  • Added handling of NewWindowRequested event

Links

Licensing

The code in this project is licensed under MIT license.