Extensions

Experimental

Defines commands and events for browser extensions.

Commands

Extensions.triggerAction

Runs an extension default action.
Available if the client is connected using the --remote-debugging-pipe
flag and the --enable-unsafe-extension-debugging flag is set.

Parameters
Name Type Description
id string Extension id.
targetId string A tab target ID to trigger the default extension action on.

Extensions.loadUnpacked

Installs an unpacked extension from the filesystem similar to
--load-extension CLI flags. Returns extension ID once the extension
has been installed. Available if the client is connected using the
--remote-debugging-pipe flag and the --enable-unsafe-extension-debugging
flag is set.

Parameters
Name Type Description
path string Absolute file path.
enableInIncognito (optional) boolean Enable the extension in incognito
Return Object
Name Type Description
id string Extension id.

Extensions.getExtensions

Gets a list of all unpacked extensions.
Available if the client is connected using the --remote-debugging-pipe flag
and the --enable-unsafe-extension-debugging flag is set.

Return Object
Name Type Description
extensions array<ExtensionInfo>

Extensions.uninstall

Uninstalls an unpacked extension (others not supported) from the profile.
Available if the client is connected using the --remote-debugging-pipe flag
and the --enable-unsafe-extension-debugging.

Parameters
Name Type Description
id string Extension id.

Extensions.getStorageItems

Gets data from extension storage in the given `storageArea`. If `keys` is
specified, these are used to filter the result.

Parameters
Name Type Description
id string ID of extension.
storageArea StorageArea StorageArea to retrieve data from.
keys (optional) array<string> Keys to retrieve.
Return Object
Name Type Description
data object

Extensions.removeStorageItems

Removes `keys` from extension storage in the given `storageArea`.

Parameters
Name Type Description
id string ID of extension.
storageArea StorageArea StorageArea to remove data from.
keys array<string> Keys to remove.

Extensions.clearStorageItems

Clears extension storage in the given `storageArea`.

Parameters
Name Type Description
id string ID of extension.
storageArea StorageArea StorageArea to remove data from.

Extensions.setStorageItems

Sets `values` in extension storage in the given `storageArea`. The provided `values`
will be merged with existing values in the storage area.

Parameters
Name Type Description
id string ID of extension.
storageArea StorageArea StorageArea to set data in.
values object Values to set.

Types

StorageArea

(string)

Storage areas.

Allowed Values
  • session
  • local
  • sync
  • managed

ExtensionInfo

(object)

Detailed information about an extension.

Properties
Name Type Description
id string Extension id.
name string Extension name.
version string Extension version.
path string The path from which the extension was loaded.
enabled boolean Extension enabled status.

Summary