DotNetBrowser explained
DotNetBrowser is a proprietary .NET library that provides a Chromium-based engine which can be used to load and display web pages.[2] [3] [4] It is developed and supported by TeamDev since 2015.
Features
Some main features are as follows:
- Load and display the web page.
- Embed a Chromium-based browser in a .NET desktop application as an Avalonia UI, WPF or Windows Forms control.[5]
- Handle navigation and network events.
- Access Document Object Model of the loaded web page.
- Execute JavaScript on the loaded web page, inject .NET objects and call them from JavaScript[6] [7] [8]
Usage
Primary usage is embedding a browser into various .NET desktop applications and displaying the web pages.[9] DotNetBrowser can be used as a headless browser. The headless mode is also available on Linux and macOS.
Another known use-cases are creating web-based kiosk applications[10] and VSTO add-ins for Microsoft Office.[11]
More examples and use-cases are available in the DotNetBrowser Examples repository.
Example
WPF
XAML markup C#using System;using System.Windowsusing DotNetBrowser.Browser;using DotNetBrowser.Engine;
namespace Sample.Wpf;
public partial class MainWindow : Window
Windows Forms
C#using System;using System.Windows.Forms;using DotNetBrowser.Browser;using DotNetBrowser.Engine;using DotNetBrowser.WinForms;
namespace Sample.WinForms;
public partial class Form1 : Form
See also
External links
- - the DotNetBrowser support website containing documentation and release notes.
- - the repository containing various examples of using DotNetBrowser.
Notes and References
- Web site: DotNetBrowser Product Licence Agreement. 12 March 2021. TeamDev. TeamDev.
- Web site: DotNetBrowser on StackOverflow . 14 March 2021.
- Web site: DotNetBrowser on NuGet. 14 March 2021.
- Web site: c # - i want to get location information with dotnetbrowser.
- Web site: Chromium Web Browser Control in .NET Applications . DZone . 2021-05-19 . 2021-05-19 . https://web.archive.org/web/20210519152432/https://dzone.com/articles/chromium-web-browser-control . dead .
- Web site: DotNetBrowser and invalid external method call.
- Web site: Using dotnetbrowser to call JavaScript function to c#. 14 June 2018 .
- Web site: The mutual call between the JS code of the DotNetBrowser internal page and the external C# code. 2021-05-19. 2021-05-19. https://web.archive.org/web/20210519151102/https://my.oschina.net/Tsybius2014/blog/1055590. dead.
- Web site: Creating an HTML UI for Desktop .NET Applications. 12 March 2021. InfoQ. InfoQ.
- Web site: Mihika Kapoor . Frame Building with C# and VB.NET . medium.com . 2 July 2016 . 17 May 2021.
- Web site: Using VSTO to develop Word AddIn, is there a third-party kernel that can replace webbrowser? . 21 May 2021.