I'd like to create a custom browser using DotNetBrowser, is there any support or hacks to enable using Chrome/Firefox/Opera extensions? I know a lot of extensions deal with browser specific UI elements that would not be possible to emulate, but some parts of the extension code just deals with the html page so chromium should support at least part of the code. I'm especially interested in ad blocking. Has anyone done this? Thanks
2 Answers
The latest preview version of DotNetBrowser supports Chrome extensions. In particular, ad-blocking extensions work fine.
The build itself is available on NuGet, but since it requires a license, take a look at the official announcement to learn how to get one.
Installing the extension is straightforward:
// Grant permissions.
var extensions = engine.Profiles.Default.Extensions;
extensions.ValidatePermissionsHandler =
new Handler<ValidatePermissionsParameters, ValidatePermissionsResponse>(
p => ValidatePermissionsResponse.Grant()
);
// Install directly from the web store
var extension = extensions.Install("https://chrome.google.com/webstore/detail/…").Result;
// or from a CRX file
var extension = extensions.Install("C:\\extension.crx").Result;
To open the extension pop-up, call this:
// The action will interact with this `browser`.
// Think of it as the active tab.
extension.GetAction(browser).Click();
I should note that CefSharp has had extension support for five years already (pull request). However, the support is very limited. This will change when they adopt the new CEF's Chrome runtime.
You can find this blog post useful. It reviews the extension API of both libraries and gives more context on CefSharp's situation.

- 527
- 1
- 7
- 17
Unfortunately, the current version of DotNetBrowser does not support Chrome extensions. As a result, there is no way to enable extension support in the current version of DotNetBrowser.

- 1
- 1
- 8
- 9
-
1Thank you, would be great to have this feature. – Jul 09 '16 at 13:28