Note: Advice in this article will only work for DotNetBrowser 1.
See the corresponding article for DotNetBrowser 2 here.
Using the DotNetBrowser.Browser
instance you can work with the Chromium engine. This interface provides methods for loading a web page by URL, loading HTML content, getting the HTML content of the loaded web page, executing JavaScript, navigating through the navigation history, accessing the Browser
loading, status events, etc.
The Browser
instance itself works in the off-screen (headless) mode. It knows nothing about the available UI frameworks and does not display any UI elements like popups or dialogs. This is useful for the cases when you are working in a pure console application without any UI. The UI elements will be displayed by the Browser
instance if and only if it is bound to the BrowserView
.
When you don’t need to use the Browser
instance you should dispose of it using the Browser.Dispose()
method. This method releases all allocated resources by instance and terminates all corresponding native processes.