Documentation: Chrome Management API
A promise-based wrapper for the Chrome management API to manage extensions and apps.
- isAvailableManagement()
- 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)
isAvailableManagement(method?: ApiMethodName<typeof chrome.management>): booleanThe optional method is a native function name, for example isAvailableManagement("getSelf").
Import the public ApiMethodName type from @addon-core/browser for your own typed helpers.
This checks callable presence without invoking the method; permissions and argument support still require handling.
Returns true when the management namespace is present on the API selected by browser() in the current context.
Returns false if the namespace or WebExtension environment is absent, or if accessing it throws.
The check is synchronous, does not log, and reads the current API on every call without caching.
Without an argument, it checks namespace presence only. Pass a native method name to also check that it is callable.
Neither form verifies permissions, argument support, or a successful operation. See method availability.
import {isAvailableManagement} from "@addon-core/browser";
if (isAvailableManagement()) {
// The namespace is present; handle operation-specific failures when using it.
}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.