Table of Contents

Interface IExtension

Namespace
DotNetBrowser.Extensions
Assembly
DotNetBrowser.dll

A Chromium extension.

Extensions can be installed via the IExtensions instance. It's possible to install an extension either from the CRX file or from the Chrome WebStore. Each extension is installed on a per-profile basis, and is not shared with other profiles.

public interface IExtension : IAutoDisposable
Inherited Members

Remarks

There are certain limitations related to Chromium tabs, windows, and other UI elements. The windows.Window Extensions API object is mapped to a native window associated with the browser, not the .NET window it is embedded into. Thus, methods and properties of the windows.Window object, such as Window.width, Window.height, Window.focused, etc. are bound to that native window.

From Chromium's perspective, each browser is a window with one tab. Extensions that manipulate tabs, tab groups, or windows should be used with caution, as they might not work as expected.

Below is the list of Chromium Extension APIs that are not supported in DotNetBrowser:

  • chrome.tabs.discard,
  • chrome.tabs.remove,
  • chrome.tabs.duplicate,
  • chrome.windows.remove,
  • chrome.windows.update,
  • chrome.window.create with more than one URL in parameters,
  • chrome.sessions.restore,
  • chrome.downloads.*,
  • chrome.desktopCapture.chooseDesktopMedia.

If an extension calls an unsupported method that returns a Promise, it will be rejected with an error. If a method accepts a callback, the chrome.runtime.lastError property will be set to an error.

Properties

HasAction

Indicates whether an extension has an action.

Id

Gets the identifier of the extension.

Name

Gets the name of the extension.

OpenExtensionPopupHandler

Gets or sets a handler that is used when the extension is about to open a popup window.

Profile

Gets the profile instance associated with this extension.

Methods

GetAction(IBrowser)

Gets the extension action for the given browser.

Uninstall()

Uninstalls this extension.