Skip to content

Latest commit

 

History

History
197 lines (126 loc) · 4.6 KB

File metadata and controls

197 lines (126 loc) · 4.6 KB

management

Documentation: Chrome Management API

A promise-based wrapper for the Chrome management API to manage extensions and apps.

Methods

Events


createAppShortcut

createAppShortcut(id: string): Promise<void>

Creates a desktop shortcut for the specified app ID.

generateAppForLink

generateAppForLink(url: string, title: string): Promise<chrome.management.ExtensionInfo>

Generates a Chrome app for the given URL and title, returning its extension info.

getExtensionInfo

getExtensionInfo(id: string): Promise<chrome.management.ExtensionInfo>

Retrieves information about the extension or app with the specified ID.

getAllExtensionInfo

getAllExtensionInfo(): Promise<chrome.management.ExtensionInfo[]>

Retrieves information about all installed extensions and apps.

getPermissionWarningsById

getPermissionWarningsById(id: string): Promise<string[]>

Gets permission warning messages for the specified extension ID.

getPermissionWarningsByManifest

getPermissionWarningsByManifest(manifestStr: string): Promise<string[]>

Gets permission warning messages for the given manifest string.

getCurrentExtension

getCurrentExtension(): Promise<chrome.management.ExtensionInfo>

Retrieves information about the current extension.

launchExtensionApp

launchExtensionApp(id: string): Promise<void>

Launches the specified extension app by ID.

setExtensionEnabled

setExtensionEnabled(id: string, enabled: boolean): Promise<void>

Enables or disables the specified extension or app.

setExtensionLaunchType

setExtensionLaunchType(id: string, launchType: string): Promise<void>

Sets the launch type (for example, regular or pinned) for the specified extension.

uninstallExtension

uninstallExtension(id: string, showConfirmDialog?: boolean): Promise<void>

Uninstalls the extension with the given ID, optionally showing a confirmation dialog.

uninstallCurrentExtension

uninstallCurrentExtension(showConfirmDialog?: boolean): Promise<void>

Uninstalls the current extension, optionally showing a confirmation dialog.

onExtensionDisabled

onExtensionDisabled(
  callback: (info: chrome.management.ExtensionInfo) => void
): () => void

Adds a listener that fires when an extension or app is disabled. Returns an unsubscribe function.

onExtensionEnabled

onExtensionEnabled(
  callback: (info: chrome.management.ExtensionInfo) => void
): () => void

Adds a listener that fires when an extension or app is enabled. Returns an unsubscribe function.

onExtensionInstalled

onExtensionInstalled(
  callback: (info: chrome.management.ExtensionInfo) => void
): () => void

Adds a listener that fires when an extension or app is installed. Returns an unsubscribe function.

onExtensionUninstalled

onExtensionUninstalled(
  callback: (extensionId: string) => void
): () => void

Adds a listener that fires when an extension or app is uninstalled, passing its ID. Returns an unsubscribe function.