DotNetBrowser
≈ 2 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
DotNetBrowser is a proprietary .NET library that provides a Chromium-based engine which can be used to load and display web pages. It is developed and supported by TeamDev since 2015.
DotNetBrowser is a proprietary .NET library that provides a Chromium-based engine which can be used to load and display web pages. 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. 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 ==Usage== Primary usage is embedding a browser into various .NET desktop applications and displaying the web pages. 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 and VSTO add-ins for Microsoft Office. More examples and use-cases are available in the DotNetBrowser Examples repository. ==Example== ===WPF=== XAML markup C# using System; using System.Windows using DotNetBrowser.Browser; using DotNetBrowser.Engine; namespace Sample.Wpf; public partial class MainWindow : Window { private readonly IEngine _engine; private readonly IBrowser _browser; public MainWindow() { InitializeComponent(); // Create and initialize the IEngine _engine = EngineFactory.Create(); // Create the IBrowser _browser = engine.CreateBrowser(); _browser.Navigation.LoadUrl("https://teamdev.com/dotnetbrowser"); // Initialize the WPF BrowserView control browserView.InitializeFrom(browser); } private void MainWindow_OnClosed(object sender, EventArgs e) { _browser.Dispose(); _engine.Dispose(); } } ===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 { private readonly IEngine _engine; private readonly IBrowser _browser; public Form1() { InitializeComponent(); // Create and initialize the IEngine _engine = EngineFactory.Create(); // Create the Windows Forms BrowserView control var browserView = new BrowserView { Dock = DockStyle.Fill }; // Create the IBrowser _browser = engine.CreateBrowser(); _browser.Navigation.LoadUrl("https://teamdev.com/dotnetbrowser"); // Initialize the Windows Forms BrowserView control browserView.InitializeFrom(browser); // Add the BrowserView control to the Form Controls.Add(browserView); Closed += Form1Closed; } private void Form1Closed(object sender, EventArgs e) { _browser.Dispose(); _engine.Dispose(); } } ==See also== Chromium Embedded Framework Electron ==External links== - the DotNetBrowser support website containing documentation and release notes. - the repository containing various examples of using DotNetBrowser.
Text derived from https://en.wikipedia.org/w/index.php?oldid=1303886558 under CC BY-SA 4.0; modifications have been made.