.NET Winforms web browser control

All the features of WebView2 with synchronous DOM and API access

.NET DOM and API

Full access browser DOM and APIs, using synchronous code in .NET

Faster development

All the power and speed of WebView2 in a synchronous control

Based on WebView2

Access all the functionality of the chrome based WebView2 control

Create hybrid .NET apps

Easily create hybrid apps with full control from your .NET code

Host your own objects

Host your own .NET objects inside the browser

Fixed or evergreen

Utilise WebView2 fixed or evergreen release channel

Easy to use browser control for .NET

Designed for fast development

DOMView2 offers a fast upgrade path from the .NET webbrowser control, without having to tackle async coding to access the DOM and other APIs of WebView2.

The control is a .NET 4.8 wrapper control for the WebView2 browser, giving direct access to the underlying DOM and browser APIs, from your .NET code.

It provides the internal DOM and APIs of WebView2 as synchronous native .NET methods and properties. You have direct synchronous access to the entire DOM, including shadow elements and iframes.

DOMView2 raises standard events asynchronously, so you can interact with the underlying browser control immediately after the native event has been raised.

The DOM and APIs follow as closely as possible the name conventions as the browser APIs, so you can use exactly the same code in your project as found in the MDN developer resources.

Main features

  • Faster browser development
  • Easy to use as webbrowser
  • Native DOM and API access
  • Username and password entry
  • Synchronous DOM and API
  • DOM events raised in .NET
  • Easy contextmenu support
  • Resource loading control
  • Synchronous fetch API
  • Winforms address bar
  • Winforms tab control
  • Perpetual licencing model
Sample projects on GitHub Read the documentation

Tab and address bar controls

Tabbed browser control

The Winforms tabbed browser control allows you to easily create a tabbed browser without any code

Each tab displays the web site favicon and title and can be dragged to re-order.

Address bar control

Has all the functionality needed for the address bar, including google search lookup and connection status.

Click the web site information icon to see the connection status and view the site certificate.

Simple quick start

Getting started with DOMView is simple, just add a DOMView2 control to a form and call Navigate().

Using the tabbed browser control is just as simple, add the DVTabStrip control to a form and call CreateTab().

The Url for both methods is parsed so you can simply use mysite.com, instead of https://mysite.com

VB

Private Sub Form_Load(sender As Object, e As EventArgs) Handles MyBase.Load
	' Navigate a single browser instance
	DOMView.Navigate("mysite.com")

	' Navigate the tabbed browser control
	TabBar.CreateTab("mysite.com")
End Sub
	

Accessing DOM and API from .NET

Developing and debugging your browser app with DOMView2 is far quicker and easier than having to inject javascript, then log and debug errors through devtools.

Inserting HTML into the DOM:

With DOMView, you can insert, change or query the DOM from .NET

VB

' Loop over queried elements and insert element
For Each Item In DomView.document.querySelectorAll("div.my-class")
	Dim Elm As DVDiv = Domview.document.createElement("div");
	Elm.innerText = "This is the inserted element";
	Item.insertAdjacentElement("afterBegin", elm)
Next
C#

// Loop over queried elements and insert HTML
foreach(DVHTMLElement item in DomView.document.querySelectorAll("div.my-class")){
	item.insertAdjacentHTML("afterBegin", "<div>This is the inserted element</div>")
}

DOM event handlers inside .NET:

Injecting events to be raised in .NET with WebView2

.NET

// Execute javascript to raise a single event
await browser.CoreWebView2.ExecuteScriptAsync(
	"document.body.addEventListener('click', function(e){window.chrome.webview.postMessage(e.type)}"
	)

In DOMView2 a single event is raised on the browser or individual elements for all DOM events.

VB

' DOMView event to receive all window events
Private Sub DOMView_DOMEvent(Sender As DVWindow, e As DVEvent) Handles DOMView.DOMEvent
	If e.type = "click" Then
		Select Case e.target.id
			Case "button1"
				Sender.document.location.href = "https://web-site/page1.html"
			Case "button2"
				Sender.document.location.href = "https://web-site/page2.html"
		End Select
	End If
End Sub

Raised to allow preventDefault() and stopPropagation() to be called on the native javascript event.

C#

// DOMView2 BeforeEvent allows events to be cancelled
private void Body_BeforeEvent(DVWindow Sender, DVBeforeEventArgs e)
{
	if (e.type == "click")
		// Click event is cancelled when script evaluates to true
		e.EvalScript = "e.target==document.querySelector('a.aClass')";
}
Read the documentation Sample projects on GitHub

Pricing and licence details

Simple lifetime licence per project

Introductory single project licence:

Lifetime licence to use DOMView2 in a single project, with updates for one year after purchase
(Including VAT where applicable)

£150

Licence details

  • Each licence is permanent and includes software updates for one year after purchase.
  • Unlimited support is available through our documentation and issues page on GitHub.
  • Future updates can be purchased at a discount: 80% in the second year, reducing by 20% each year.
  • DOMView2 can be tested in the sample projects here or in your own project, where it will show an unlicensed banner.
  • If you have any questions or need more information about DOMView2 please contact us.