Documentation: Chrome Management API
A promise-based wrapper for the Chrome management API to manage extensions and apps.
- createAppShortcut(id)
- generateAppForLink(url, title)
- getExtensionInfo(id)
- getAllExtensionInfo()
- getPermissionWarningsById(id)
- getPermissionWarningsByManifest(manifestStr)
- getCurrentExtension()
- launchExtensionApp(id)
- setExtensionEnabled(id, enabled)
- setExtensionLaunchType(id, launchType)
- uninstallExtension(id, showConfirmDialog?)
- uninstallCurrentExtension(showConfirmDialog?)
- onExtensionDisabled(callback)
- onExtensionEnabled(callback)
- onExtensionInstalled(callback)
- onExtensionUninstalled(callback)
createAppShortcut(id: string): Promise<void>
Creates a desktop shortcut for the specified app ID.
generateAppForLink(url: string, title: string): Promise<chrome.management.ExtensionInfo>
Generates a Chrome app for the given URL and title, returning its extension info.
getExtensionInfo(id: string): Promise<chrome.management.ExtensionInfo>
Retrieves information about the extension or app with the specified ID.
getAllExtensionInfo(): Promise<chrome.management.ExtensionInfo[]>
Retrieves information about all installed extensions and apps.
getPermissionWarningsById(id: string): Promise<string[]>
Gets permission warning messages for the specified extension ID.
getPermissionWarningsByManifest(manifestStr: string): Promise<string[]>
Gets permission warning messages for the given manifest string.
getCurrentExtension(): Promise<chrome.management.ExtensionInfo>
Retrieves information about the current extension.
launchExtensionApp(id: string): Promise<void>
Launches the specified extension app by ID.
setExtensionEnabled(id: string, enabled: boolean): Promise<void>
Enables or disables the specified extension or app.
setExtensionLaunchType(id: string, launchType: string): Promise<void>
Sets the launch type (for example, regular or pinned) for the specified extension.
uninstallExtension(id: string, showConfirmDialog?: boolean): Promise<void>
Uninstalls the extension with the given ID, optionally showing a confirmation dialog.
uninstallCurrentExtension(showConfirmDialog?: boolean): Promise<void>
Uninstalls the current extension, optionally showing a confirmation dialog.
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(
callback: (info: chrome.management.ExtensionInfo) => void
): () => void
Adds a listener that fires when an extension or app is enabled. Returns an unsubscribe function.
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(
callback: (extensionId: string) => void
): () => void
Adds a listener that fires when an extension or app is uninstalled, passing its ID. Returns an unsubscribe function.