BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Microsoft Edge WebView2 Now Generally Available

Microsoft Edge WebView2 Now Generally Available

This item in japanese

After publishing last year a preview release of WebView2, a Chromium-based control to host web content within native Windows applications, Microsoft recently announced the general availability of WebView2 for production Win32 C/C++, .NET Framework, .NET Core, and .NET 5 applications. WebView2 provides two distribution models (evergreen and fixed) with a different update policy (automatic or manual).

Microsoft explains the rationale behind embedding WebView2 controls in native Windows applications:

Developers often have to decide between building a web application or a native application. The decision hinges on the trade-off between reach and power. Web applications allow for a broad reach. […] Native applications, however, utilize the capabilities of the entire native platform.
Hybrid applications allow developers to enjoy the best of both worlds. Hybrid application developers benefit from the ubiquity and strength of the web platform, and the power and full capabilities of the native platform.

Thanks to WebView2, developers may either build an entire Windows application with web technologies or embed custom web-based app elements or PWAs in their application. By using web code (HTML/JavaScript/CSS), developers may reuse a large existing application, component — and talent base. Developers may for instance leverage web components from Microsoft’s new FAST framework library.

Partially building an application with WebView may require a varying level of communication and coordination between host and web content. Just like when communicating between browser threads, developers may use the postMessage API (concretely the window.chrome.webview.postMessage method) for communication between web content and the Windows host. Communication in the other direction is achieved by registering listeners on the web side with the window.chrome.webview.addEventListener method. The bidirectional communication then provides conversational capabilities between host and web sides, allowing for instance the web content to fully use the host’s native APIs.

WebView2 is distributed through two versions: the evergreen and the fixed versions. The evergreen WebView2 version will be automatically and regularly (every six weeks) updated by Microsoft. The fixed version packs a given version of the WebView2 Runtime that must be updated manually when desired. The evergreen version seeks to reduce fragmentation and give developers access to the latest web APIs. The fixed version caters to those applications with strict compatibility requirements.

Microsoft listed the platforms that WebView2 supports:

  • Windows 10
  • Windows 8.1
  • Windows 7 **
  • Windows Server 2019
  • Windows Server 2016
  • Windows Server 2012
  • Windows Server 2012 R2
  • Windows Server 2008 R2 **

Developers looking to get started with WebView 2 should review the WebView2 getting started tutorial and read the WebView2 documentation. Comprehensive samples are available online. The WebView team encourages feedback to improve future WebView releases.

Rate this Article

Adoption
Style

BT