List icon Contents

Chromium

This guide describes how to work with the Chromium build used by DotNetBrowser.

You do not need to install Chromium or Google Chrome on the target environment to use DotNetBrowser as it uses and deploys its own Chromium build.

Binaries

Chromium binaries for each supported platform are located inside the corresponding DotNetBrowser DLLs:

  • DotNetBrowser.Chromium.Win-x86.dll – Chromium binaries for Windows 32-bit.
  • DotNetBrowser.Chromium.Win-x64.dll – Chromium binaries for Windows 64-bit.
  • DotNetBrowser.Chromium.Win-arm64.dll – Chromium binaries for Windows ARM64.
  • DotNetBrowser.Chromium.Linux-x64.dll – Chromium binaries for Linux 64-bit.
  • DotNetBrowser.Chromium.Linux-arm64.dll – Chromium binaries for Linux ARM64.
  • DotNetBrowser.Chromium.macOS-x64.dll – Chromium binaries for macOS 64-bit.
  • DotNetBrowser.Chromium.macOS-arm64.dll – Chromium binaries for macOS ARM64 (Apple Silicon).

To use Chromium, you need to extract its binaries.

Extraction

DotNetBrowser extracts the Chromium binaries for the target platform from the corresponding DLL during the first launch.

On Windows, they are placed in the %LocalAppData%\Temp\dotnetbrowser-chromium directory.

On macOS and Linux, the binaries are extracted into the user’s temp directory.

DotNetBrowser checks whether the directory contains the required Chromium files. If no files are found, it extracts the binaries from the DLLs referenced in the application.

You can customize the default path to the directory, where the binaries are extracted, or extract the binaries programmatically and tell the library where they are located:

EngineOptions options = new EngineOptions.Builder
{
    ChromiumDirectory = @"C:\Users\Me\.DotNetBrowser"
}
.Build();
binariesExtractor = new ChromiumBinariesExtractor();
binariesExtractor.ExtractBinariesIfNecessary(options);
// ...
engine = EngineFactory.Create(options);
Dim options = New EngineOptions.Builder With 
{
    .ChromiumDirectory = "C:\Users\Me\.DotNetBrowser\chromium"
}.Build()
Dim binariesExtractor = New ChromiumBinariesExtractor()
binariesExtractor.ExtractBinariesIfNecessary(options)
' ...
engine = EngineFactory.Create(options)

Chromium Version

You can obtain the information on Chromium version used by the current version of DotNetBrowser as ChromiumInfo.Version constant value. This field allows you to return the version of Chromium engine programmatically in your project.

Location

You can specify the path to the Chromium binaries directory using EngineOptions when constructing the IEngine as shown in the code sample below:

IEngine engine = EngineFactory.Create(new EngineOptions.Builder
{
    ChromiumDirectory = @"C:\Users\Me\.DotNetBrowser\chromium"
}
.Build());
Dim engine As IEngine = EngineFactory.Create(New EngineOptions.Builder With 
{
    .ChromiumDirectory = "C:\Users\Me\.DotNetBrowser\chromium"
}.Build())

The path can be either relative or absolute.

If the directory already has the required Chromium binaries, the library will not perform the extraction.

If the directory is corrupted and some Chromium files are missing, DotNetBrowser will extract the binaries and overwrite the existing files.

Verification

Each DotNetBrowser version is only compatible with its own Chromium binaries. The binaries for a specific version do not support other DotNetBrowser versions.

To make sure that the Chromium binaries are compatible with the current DotNetBrowser version, the library verifies the binaries.

Switches

Chromium accepts the command line switches that change the behavior of the features, help to debug, or turn the experimental features on.

The list of switches and their description can be found in the documentation provided by Peter Beverloo.

DotNetBrowser does not support all the Chromium switches. Therefore, we recommend configuring Chromium using the Engine Options instead of switches.

Sandbox

Windows

DotNetBrowser supports Chromium Sandbox on Windows. Sandbox is enabled by default, but you can disable it using the code sample below:

engine = EngineFactory.Create(new EngineOptions.Builder 
{
    SandboxDisabled  = true
}
.Build());
engine = EngineFactory.Create(New EngineOptions.Builder With 
{
    .SandboxDisabled = True
}.Build())

Chrome extensions

DotNetBrowser does not support the extensions designed for the Chrome application.

The library integrates only with the web browser control that renders the web content. Thus, it does not have the Chrome GUI, with elements like tool bar and context menu, required to integrate the extensions.

Go Top