management API
Hint
The management API is inherited from Firefox, and its primary documentation is maintained by Mozilla at MDN. Thunderbird implements only the subset of functions, events, and types listed here. The MDN pages may provide further details and examples, but they may also reference features that are not supported in Thunderbird.
The browser.management API provides ways to manage the list of extensions that are installed and running.
Permissions
The following permissions influence the behavior of the API. Depending on which permissions are requested, additional methods might be available, or certain data may be included in responses.
Hint
Request permissions only when needed. Unnecessary requests may result in rejection during ATN review.
management
Monitor extension usage and manage themes.
Functions
get(id)
– [Added in TB 56]
Returns information about the installed extension that has the given ID.
Required permissions
getAll()
– [Added in TB 55]
Returns a list of information about installed extensions.
Note
Before version 56, only extensions whose ‘type’ is ‘theme’ are returned.
Required permissions
getSelf()
– [Added in TB 51]
Returns information about the calling extension. Note: This function can be used without requesting the ‘management’ permission in the manifest.
install(options)
– [Added in TB 63]
Installs and enables a theme extension from the given url.
Note
The installable file pointed to by url must be a theme, and not a normal browser extension.
Parameters
options
Required permissions
setEnabled(id, enabled)
– [Added in TB 55]
Enables or disables the given add-on.
Note
Only extensions whose ‘type’ is ‘theme’ can be enabled and disabled.
Parameters
id
ID of the add-on to enable/disable.
enabled
Whether to enable or disable the add-on.
Required permissions
uninstallSelf([options])
– [Added in TB 51]
Uninstalls the calling extension. Note: This function can be used without requesting the ‘management’ permission in the manifest.
Parameters
options
Events
onDisabled
– [Added in TB 55]
Fired when an addon has been disabled.
Note
Before version 56, only extensions whose type is ‘theme’ are supported.
Parameters for onDisabled.addListener(listener)
listener(info)
A function that will be called when this event occurs.
Required permissions
onEnabled
– [Added in TB 55]
Fired when an addon has been enabled.
Note
Before version 56, only extensions whose type is ‘theme’ are supported.
Parameters for onEnabled.addListener(listener)
listener(info)
A function that will be called when this event occurs.
Required permissions
onInstalled
– [Added in TB 55]
Fired when an addon has been installed.
Note
Before version 56, only extensions whose type is ‘theme’ are supported.
Parameters for onInstalled.addListener(listener)
listener(info)
A function that will be called when this event occurs.
Required permissions
onUninstalled
– [Added in TB 55]
Fired when an addon has been uninstalled.
Note
Before version 56, only extensions whose type is ‘theme’ are supported.
Note
This event is not fired when the extension is in the “pending uninstall” state. The event is fired as expected once the extension is completely removed (for example, when the about:addons tab is closed).
Parameters for onUninstalled.addListener(listener)
listener(info)
A function that will be called when this event occurs.
Required permissions
Types
ExtensionDisabledReason
A reason the item is disabled.
ExtensionID
string
or
string
ExtensionInfo
– [Added in TB 51]
Information about an installed extension.
object
description
The description of this extension.
enabled
Whether it is currently enabled or disabled.
id
The extension’s unique identifier.
installType
How the extension was installed.
mayDisable
Whether this extension can be disabled or uninstalled by the user.
name
The name of this extension.
optionsUrl
The url for the item’s options page, if it has one.
type
The type of this extension, ‘extension’ or ‘theme’.
version
disabledReason
A reason the item is disabled.
homepageUrl
The URL of the homepage of this extension.
hostPermissions
Returns a list of host based permissions.
icons
A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details.
permissions
Returns a list of API based permissions.
shortName
A short version of the name of this extension.
updateUrl
The update URL of this extension.
versionName
The version name of this extension if the manifest specified one.
ExtensionInstallType
How the extension was installed. One of development: The extension was loaded unpacked in developer mode, normal: The extension was installed normally via an .xpi file, sideload: The extension was installed by other software on the machine, admin: The extension was installed by policy, other: The extension was installed by other means.
ExtensionType
The type of this extension, ‘extension’ or ‘theme’.
HttpURL
string
IconInfo
Information about an icon belonging to an extension.
object
size
A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16.
url
The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append ?grayscale=true to the URL.