mozilla

Revision 65143 of AddonManager

  • Revision slug: Addons/Add-on_Manager/AddonManager
  • Revision title: AddonManager
  • Revision id: 65143
  • Created:
  • Creator: Mossop
  • Is current revision? No
  • Comment 12 words added

Revision Content

{{ gecko_minversion_header("2.0") }}

The AddonManager object is the global API used to access information about add-ons installed in the application and to manipulate them. The majority of the methods are asynchronous meaning that results are delivered through callbacks passed to the method. The callbacks will be called just once but that may be before or after the method returns.

One of the forces of the AddonManager is that it deals with any kind (type) of addon in generic manner. To do so many methods of the AddonManager take the addon types as parameters. The existing addon types are defined in XPIProvider.jsm and are, at this time, the following: extension, theme, locale, multipackage.

To import the AddonManager object, use:

Components.utils.import("resource://gre/modules/AddonManager.jsm");

Method Overview

void getInstallForURL(in string url, in InstallCallback callback, in string mimetype, in string hash, in string name, in string iconURL, in string version, in {{ Interface("nsILoadGroup") }} loadGroup)
void getInstallForFile(in {{ Interface("nsIFile") }} file, in InstallCallback callback, in string mimetype)
void getAllInstalls(in InstallListCallback callback)
void getInstallsByTypes(in string types[], in InstallListCallback callback)
void installAddonsFromWebpage(in string mimetype, in {{ Interface("nsIDOMWindow") }} source, in {{ Interface("nsIURI") }} uri, in {{ AMInterface("AddonInstall") }} installs[])
void addInstallListener(in {{ AMInterface("InstallListener") }} listener)
void removeInstallListener(in {{ AMInterface("InstallListener") }} listener)
void getAllAddons(in AddonListCallback callback)
void getAddonByID(in string id, in AddonCallback callback)
void getAddonsByIDs(in string ids[], in AddonListCallback callback)
void getAddonsByTypes(in string types[], in AddonListCallback callback)
void getAddonsWithOperationsByTypes(in string types[], in AddonListCallback callback)
void addAddonListener(in {{ AMInterface("AddonListener") }} listener)
void removeAddonListener(in {{ AMInterface("AddonListener") }} listener)
void addTypeListener(in {{ AMInterface("TypeListener") }} listener){{ gecko_minversion_inline("6") }}
void removeTypeListener(in {{ AMInterface("TypeListener") }} listener){{ gecko_minversion_inline("6") }}

Properties Overview

Attribute Type Description
addonTypes dictionary A dictionary that maps type ID to {{ AMInterface("AddonType") }}.

Callbacks

InstallCallback()

A callback that is passed a single {{ AMInterface("AddonInstall") }}

void InstallCallback(
  in {{AMInterface("AddonInstall")}} install
)
Parameters
install
The {{ AMInterface("AddonInstall") }} passed back from the asynchronous request

InstallListCallback()

A callback that is passed an array of {{ AMInterface("AddonInstall") }}s

void InstallListCallback(
  in {{AMInterface("AddonInstall")}} installs[]
)
Parameters
installs
The array of {{ AMInterface("AddonInstall") }}s passed back from the asynchronous request

AddonCallback()

A callback that is passed a single {{ AMInterface("Addon") }}

void AddonCallback(
  in {{AMInterface("Addon")}} addon
)
Parameters
addon
The {{ AMInterface("Addon") }} passed back from the asynchronous request.  If an error occurred (such an addon not being found), null is passed back instead.

AddonListCallback()

A callback that is passed an array of {{ AMInterface("Addon") }}s

void AddonListCallback(
  in {{AMInterface("Addon")}} addons[]
)
Parameters
addons
The array of {{ AMInterface("Addon") }}s passed back from the asynchronous request

Constants

AddonInstall states

Constant Description
STATE_AVAILABLE An install that is waiting to be started.
STATE_DOWNLOADING An install that is in the process of being downloaded.
STATE_CHECKING An install that is checking for updated information.
STATE_DOWNLOADED An install that has finished downloaded and is ready to install.
STATE_DOWNLOAD_FAILED An install that failed to download
STATE_INSTALLING An install that is in the process of being installed.
STATE_INSTALLED An install that has successfully been installed.
STATE_INSTALL_FAILED An install that has failed to install.
STATE_CANCELLED An install that has been cancelled.

AddonInstall errors

Constant Description
ERROR_NETWORK_FAILURE A network error occured.
ERROR_INCORRECT_HASH The downloaded file did not match the expected hash.
ERROR_CORRUPT_FILE The file appears to be corrupt.
ERROR_FILE_ACCESS There was an error accessing the filesystem.

Update check reasons

Constant Description
UPDATE_WHEN_USER_REQUESTED An update check performed at the explicit request of the user.
UPDATE_WHEN_NEW_APP_DETECTED An update check performed when a new version of the application has been detected.
UPDATE_WHEN_NEW_APP_INSTALLED An update check performed after a new version of the application has been installed.
UPDATE_WHEN_PERIODIC_UPDATE An update check performed automatically in the background.
UPDATE_WHEN_ADDON_INSTALLED An update check performed when a new add-on has been installed.

Update status values

Constant Description
UPDATE_STATUS_NO_ERROR No error was encountered.
UPDATE_STATUS_TIMEOUT The update check timed out.
UPDATE_STATUS_DOWNLOAD_ERROR There was an error while downloading the update information.
UPDATE_STATUS_PARSE_ERROR The update information was malformed in some way.
UPDATE_STATUS_UNKNOWN_FORMAT

The update was not in any known format.

UPDATE_STATUS_SECURITY_ERROR

The update information was not correctly signed or there was an SSL error.

Auto update values

Constant Description
AUTOUPDATE_DISABLE Indicates that the Addon should not update automatically.
AUTOUPDATE_DEFAULT Indicates that the Addon should update automatically only if that's the global default.
AUTOUPDATE_ENABLE Indicates that the Addon should update automatically.

Pending operations

Constant Description
PENDING_NONE No operations are pending.
PENDING_ENABLE This add-on will be enabled after the application restarts.
PENDING_DISABLE This add-on will be disabled after the application restarts.
PENDING_UNINSTALL This add-on will be uninstalled after the application restarts.
PENDING_INSTALL This add-on will be installed after the application restarts.
PENDING_UPGRADE This add-on will be upgraded after the application restarts.

Permissions

Constant Description
PERM_CAN_UNINSTALL This add-on can be uninstalled.
PERM_CAN_ENABLE This add-on can be enabled.
PERM_CAN_DISABLE This add-on can be disabled.
PERM_CAN_UPGRADE This add-on can be upgraded.

Operations requiring restart

Constant Description
OP_NEEDS_RESTART_NONE No operations will require a restart.
OP_NEEDS_RESTART_ENABLE Enabling the add-on will require a restart.
OP_NEEDS_RESTART_DISABLE Disabling the add-on will require a restart.
OP_NEEDS_RESTART_UNINSTALL Uninstalling the add-on will require a restart.
OP_NEEDS_RESTART_INSTALL Installing the add-on will require a restart.

Installation scopes

Constant Description
SCOPE_ALL A combination of all the installation scopes.
SCOPE_APPLICATION This add-on is a part of the current application.
SCOPE_PROFILE This add-on is installed in the current profile directory.
SCOPE_SYSTEM This add-on is installed somewhere global to the system.
SCOPE_USER This add-on is installed somewhere specific to the current user.
Note: The extensions.enabledScopes preference lets you configure which of these scopes are enabled; however, you can't turn off the profile scope.

AddonType viewTypes{{ gecko_minversion_inline("6") }}

Constant Description
VIEW_TYPE_LIST The type should be displayed in a regular list view in the UI.

AddonType flags{{ gecko_minversion_inline("6") }}

Constant Description
TYPE_UI_HIDE_EMPTY The type should be hidden from the UI if no add-ons of that type are currently installed.

Methods

getInstallForURL()

Asynchronously gets an {{ AMInterface("AddonInstall") }} for a URL.

void getInstallForURL(
  in string url,
  in InstallCallback callback,
  in string mimetype,
  in string hash,
  in string name,
  in string iconURL,
  in string version,
  in {{Interface("nsILoadGroup")}} loadGroup
)
Parameters
url
The url the add-on is located at
callback
A callback to pass the {{ AMInterface("AddonInstall") }} to
mimetype
The mimetype of the add-on
hash
An optional hash of the add-on
name
An optional placeholder name while the add-on is being downloaded
iconURL
An optional placeholder icon URL while the add-on is being downloaded
version
An optional placeholder version while the add-on is being downloaded
loadGroup
An optional {{ Interface("nsILoadGroup") }} to associate any network requests with

getInstallForFile()

Asynchronously gets an {{ AMInterface("AddonInstall") }} for an {{ Interface("nsIFile") }}.

void getInstallForFile(
  in {{Interface("nsIFile")}} file,
  in InstallCallback callback,
  in string mimetype
)
Parameters
file
the {{ Interface("nsIFile") }} where the add-on is located
callback
A callback to pass the {{ AMInterface("AddonInstall") }} to
mimetype
An optional mimetype hint for the add-on

getAllInstalls()

Asynchronously gets all current {{ AMInterface("AddonInstall") }}s.

void getAllInstalls(
  in InstallListCallback callback
)
Parameters
callback
A callback which will be passed an array of {{ AMInterface("AddonInstall") }}s

getInstallsByTypes()

Asynchronously gets all current {{ AMInterface("AddonInstall") }}s optionally limiting to a list of types.

void getInstallsByTypes(
  in string types[],
  in InstallListCallback callback
)
Parameters
types
An optional array of types to retrieve. Each type is a string name
callback
A callback which will be passed an array of {{ AMInterface("AddonInstall") }}s

installAddonsFromWebpage()

Starts installation of an array of {{ AMInterface("AddonInstall") }}s notifying the registered web install listener of blocked or started installs.

void installAddonsFromWebpage(
  in string mimetype,
  in {{Interface("nsIDOMWindow")}} source,
  in {{Interface("nsIURI")}} uri,
  in {{AMInterface("AddonInstall")}} installs[]
)
Parameters
mimetype
The mimetype of add-ons being installed
source
The {{ Interface("nsIDOMWindow") }} that started the installs
uri
the {{ Interface("nsIURI") }} that started the installs
installs
The array of {{ AMInterface("AddonInstall") }}s to be installed

addInstallListener()

Adds a new {{ AMInterface("InstallListener") }} if the listener is not already registered.

void addInstallListener(
  in {{AMInterface("InstallListener")}} listener
)
Parameters
listener
The {{ AMInterface("InstallListener") }} to add

removeInstallListener()

Removes an {{ AMInterface("InstallListener") }} if the listener is registered.

void removeInstallListener(
  in {{AMInterface("InstallListener")}} listener
)
Parameters
listener
The {{ AMInterface("InstallListener") }} to remove

getAllAddons()

Asynchronously gets all installed {{ AMInterface("Addon") }}s.

void getAllAddons(
  in AddonListCallback callback
)
Parameters
callback
A callback which will be passed an array of {{ AMInterface("Addon") }}s

getAddonByID()

Asynchronously gets an {{ AMInterface("Addon") }} with a specific ID.

void getAddonByID(
  in string id,
  in AddonCallback callback
)
Parameters
id
The ID of the {{ AMInterface("Addon") }} to retrieve
callback
The callback to pass the retrieved {{ AMInterface("Addon") }} to

getAddonsByIDs()

Asynchronously gets an array of {{ AMInterface("Addon") }}s.

void getAddonsByIDs(
  in string ids[],
  in AddonListCallback callback
)
Parameters
ids
The array of IDs to retrieve
callback
The callback to pass an array of {{ AMInterface("Addon") }}s to

getAddonsByTypes()

Asynchronously gets {{ AMInterface("Addon") }}s of specific types.

void getAddonsByTypes(
  in string types[],
  in AddonListCallback callback
)
Parameters
types
An optional array of types to retrieve. Each type is a string name
callback
The callback to pass an array of {{ AMInterface("Addon") }}s to

getAddonsWithOperationsByTypes()

Asynchronously gets {{ AMInterface("Addon") }}s that have operations waiting for an application restart to complete.

void getAddonsWithOperationsByTypes(
  in string types[],
  in AddonListCallback callback
)
Parameters
types
An optional array of types to retrieve. Each type is a string name
callback
The callback to pass the array of {{ AMInterface("Addon") }}s to

addAddonListener()

Adds a new {{ AMInterface("AddonListener") }} if the listener is not already registered.

void addAddonListener(
  in {{AMInterface("AddonListener")}} listener
)
Parameters
listener
The {{ AMInterface("AddonListener") }} to add

removeAddonListener()

Removes an {{ AMInterface("AddonListener") }} if the listener is registered.

void removeAddonListener(
  in {{AMInterface("AddonListener")}} listener
)
Parameters
listener
The {{ AMInterface("AddonListener") }} to remove

addTypeListener(){{ gecko_minversion_inline("6") }}

Adds a new {{ AMInterface("TypeListener") }} if the listener is not already registered.

void addTypeListener(
  in {{AMInterface("TypeListener")}} listener
)
Parameters
listener
The {{ AMInterface("TypeListener") }} to add

removeTypeListener(){{ gecko_minversion_inline("6") }}

Removes a {{ AMInterface("TypeListener") }} if the listener is registered.

void removeTypeListener(
  in {{AMInterface("TypeListener")}} listener
)
Parameters
listener
The {{ AMInterface("TypeListener") }} to remove

Revision Source

<p>{{ gecko_minversion_header("2.0") }}</p>
<p>The AddonManager object is the global API used to access information about add-ons installed in the application and to manipulate them. The majority of the methods are asynchronous meaning that results are delivered through callbacks passed to the method. The callbacks will be called just once but that may be before or after the method returns.</p>
<p>One of the forces of the AddonManager is that it deals with any kind (type) of addon in generic manner. To do so many methods of the AddonManager take the addon types as parameters. The existing addon types are defined in <a class=" external" href="http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/XPIProvider.jsm" title="http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/XPIProvider.jsm">XPIProvider.jsm</a> and are, at this time, the following: <span id="the-code"> <code>extension</code>, <code>theme</code>, <code>locale</code>, </span><code><span id="the-code"><span class="a">multipackage</span></span></code>.</p>
<p>To import the AddonManager object, use:</p>
<pre>Components.utils.import("resource://gre/modules/AddonManager.jsm");
</pre>
<h2>Method Overview</h2>
<table class="standard-table"> <tbody> <tr> <td><code>void <a href="#getInstallForURL()">getInstallForURL</a>(in string url, in <a href="#InstallCallback()">InstallCallback</a> callback, in string mimetype, in string hash, in string name, in string iconURL, in string version, in {{ Interface("nsILoadGroup") }} loadGroup)</code></td> </tr> <tr> <td><code>void <a href="#getInstallForFile()">getInstallForFile</a>(in {{ Interface("nsIFile") }} file, in <a href="#InstallCallback()">InstallCallback</a> callback, in string mimetype)</code></td> </tr> <tr> <td><code>void <a href="#getAllInstalls()">getAllInstalls</a>(in <a href="#InstallListCallback()">InstallListCallback</a> callback)</code></td> </tr> <tr> <td><code>void <a href="#getInstallsByTypes()">getInstallsByTypes</a>(in string types[], in <a href="#InstallListCallback()">InstallListCallback</a> callback)</code></td> </tr> <tr> <td><code>void <a href="#installAddonsFromWebpage()">installAddonsFromWebpage</a>(in string mimetype, in {{ Interface("nsIDOMWindow") }} source, in {{ Interface("nsIURI") }} uri, in {{ AMInterface("AddonInstall") }} installs[])</code></td> </tr> <tr> <td><code>void <a href="#addInstallListener()">addInstallListener</a>(in {{ AMInterface("InstallListener") }} listener)</code></td> </tr> <tr> <td><code>void <a href="#removeInstallListener()">removeInstallListener</a>(in {{ AMInterface("InstallListener") }} listener)</code></td> </tr> <tr> <td><code>void <a href="#getAllAddons()">getAllAddons</a>(in <a href="#AddonListCallback()">AddonListCallback</a> callback)</code></td> </tr> <tr> <td><code>void <a href="#getAddonByID()">getAddonByID</a>(in string id, in <a href="#AddonCallback()">AddonCallback</a> callback)</code></td> </tr> <tr> <td><code>void <a href="#getAddonsByIDs()">getAddonsByIDs</a>(in string ids[], in <a href="#AddonListCallback()">AddonListCallback</a> callback)</code></td> </tr> <tr> <td><code>void <a href="#getAddonsByTypes()">getAddonsByTypes</a>(in string types[], in <a href="#AddonListCallback()">AddonListCallback</a> callback)</code></td> </tr> <tr> <td><code>void <a href="#getAddonsWithOperationsByTypes()">getAddonsWithOperationsByTypes</a>(in string types[], in <a href="#AddonListCallback()">AddonListCallback</a> callback)</code></td> </tr> <tr> <td><code>void <a href="#addAddonListener()">addAddonListener</a>(in {{ AMInterface("AddonListener") }} listener)</code></td> </tr> <tr> <td><code>void <a href="#removeAddonListener()">removeAddonListener</a>(in {{ AMInterface("AddonListener") }} listener)</code></td> </tr> <tr> <td><code>void <a href="#addTypeListener()">addTypeListener</a>(in {{ AMInterface("TypeListener") }} listener)</code>{{ gecko_minversion_inline("6") }}</td> </tr> <tr> <td><code>void <a href="#removeTypeListener()">removeTypeListener</a>(in {{ AMInterface("TypeListener") }} listener)</code>{{ gecko_minversion_inline("6") }}</td> </tr> </tbody>
</table>
<h2>Properties Overview</h2>
<table class="standard-table" style="width: auto;"> <tbody> <tr> <td class="header">Attribute</td> <td class="header">Type</td> <td class="header">Description</td> </tr> <tr> <td><code>addonTypes</code></td> <td><code>dictionary</code></td> <td>A dictionary that maps type ID to {{ AMInterface("AddonType") }}.</td> </tr> </tbody>
</table>
<h2>Callbacks</h2>
<h3>InstallCallback()</h3>
<p>A callback that is passed a single {{ AMInterface("AddonInstall") }}</p>
<pre>void InstallCallback(
  in {{AMInterface("AddonInstall")}} install
)</pre>
<h6>Parameters</h6>
<dl> <dt>install</dt> <dd>The {{ AMInterface("AddonInstall") }} passed back from the asynchronous request</dd>
</dl>
<h3>InstallListCallback()</h3>
<p>A callback that is passed an array of {{ AMInterface("AddonInstall") }}s</p>
<pre>void InstallListCallback(
  in {{AMInterface("AddonInstall")}} installs[]
)</pre>
<h6>Parameters</h6>
<dl> <dt>installs</dt> <dd>The array of {{ AMInterface("AddonInstall") }}s passed back from the asynchronous request</dd>
</dl>
<h3>AddonCallback()</h3>
<p>A callback that is passed a single {{ AMInterface("Addon") }}</p>
<pre>void AddonCallback(
  in {{AMInterface("Addon")}} addon
)</pre>
<h6>Parameters</h6>
<dl> <dt>addon</dt> <dd>The {{ AMInterface("Addon") }} passed back from the asynchronous request.  If an error occurred (such an addon not being found), <code><code>null</code></code> is passed back instead.</dd>
</dl>
<h3>AddonListCallback()</h3>
<p>A callback that is passed an array of {{ AMInterface("Addon") }}s</p>
<pre>void AddonListCallback(
  in {{AMInterface("Addon")}} addons[]
)</pre>
<h6>Parameters</h6>
<dl> <dt>addons</dt> <dd>The array of {{ AMInterface("Addon") }}s passed back from the asynchronous request</dd>
</dl>
<h2>Constants</h2>
<h3>AddonInstall states</h3>
<table class="standard-table"> <tbody> <tr> <td class="header">Constant</td> <td class="header">Description</td> </tr> <tr> <td><code>STATE_AVAILABLE</code></td> <td>An install that is waiting to be started.</td> </tr> <tr> <td><code>STATE_DOWNLOADING</code></td> <td>An install that is in the process of being downloaded.</td> </tr> <tr> <td><code>STATE_CHECKING</code></td> <td>An install that is checking for updated information.</td> </tr> <tr> <td><code>STATE_DOWNLOADED</code></td> <td>An install that has finished downloaded and is ready to install.</td> </tr> <tr> <td><code>STATE_DOWNLOAD_FAILED</code></td> <td>An install that failed to download</td> </tr> <tr> <td><code>STATE_INSTALLING</code></td> <td>An install that is in the process of being installed.</td> </tr> <tr> <td><code>STATE_INSTALLED</code></td> <td>An install that has successfully been installed.</td> </tr> <tr> <td><code>STATE_INSTALL_FAILED</code></td> <td>An install that has failed to install.</td> </tr> <tr> <td><code>STATE_CANCELLED</code></td> <td>An install that has been cancelled.</td> </tr> </tbody>
</table>
<h3>AddonInstall errors</h3>
<table class="standard-table"> <tbody> <tr> <td class="header">Constant</td> <td class="header">Description</td> </tr> <tr> <td><code>ERROR_NETWORK_FAILURE</code></td> <td>A network error occured.</td> </tr> <tr> <td><code>ERROR_INCORRECT_HASH</code></td> <td>The downloaded file did not match the expected hash.</td> </tr> <tr> <td><code>ERROR_CORRUPT_FILE</code></td> <td>The file appears to be corrupt.</td> </tr> <tr> <td><code>ERROR_FILE_ACCESS</code></td> <td>There was an error accessing the filesystem.</td> </tr> </tbody>
</table>
<h3>Update check reasons</h3>
<table class="standard-table"> <tbody> <tr> <td class="header">Constant</td> <td class="header">Description</td> </tr> <tr> <td><code>UPDATE_WHEN_USER_REQUESTED</code></td> <td>An update check performed at the explicit request of the user.</td> </tr> <tr> <td><code>UPDATE_WHEN_NEW_APP_DETECTED</code></td> <td>An update check performed when a new version of the application has been detected.</td> </tr> <tr> <td><code>UPDATE_WHEN_NEW_APP_INSTALLED</code></td> <td>An update check performed after a new version of the application has been installed.</td> </tr> <tr> <td><code>UPDATE_WHEN_PERIODIC_UPDATE</code></td> <td>An update check performed automatically in the background.</td> </tr> <tr> <td><code>UPDATE_WHEN_ADDON_INSTALLED</code></td> <td>An update check performed when a new add-on has been installed.</td> </tr> </tbody>
</table>
<h3>Update status values</h3>
<table class="standard-table" style="font-size: 14px; margin-bottom: 1.286em; border-collapse: collapse; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; "> <tbody> <tr> <td class="header" style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); text-align: left; vertical-align: top; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); font-weight: bold; background-position: initial initial; background-repeat: initial initial; ">Constant</td> <td class="header" style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); text-align: left; vertical-align: top; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); font-weight: bold; background-position: initial initial; background-repeat: initial initial; ">Description</td> </tr> <tr> <td style="font-family: inherit; font-size: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; color: inherit; "><code>UPDATE_STATUS_NO_ERROR</code></td> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; ">No error was encountered.</td> </tr> <tr> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; "><code style="font: normal normal normal 100%/normal 'Courier New', 'Andale Mono', monospace; color: inherit; font-weight: inherit; ">UPDATE_STATUS_TIMEOUT</code></td> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; ">The update check timed out.</td> </tr> <tr> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; "><code style="font: normal normal normal 100%/normal 'Courier New', 'Andale Mono', monospace; color: inherit; font-weight: inherit; ">UPDATE_STATUS_DOWNLOAD_ERROR</code></td> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; ">There was an error while downloading the update information.</td> </tr> <tr> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; "><code style="font: normal normal normal 100%/normal 'Courier New', 'Andale Mono', monospace; color: inherit; font-weight: inherit; ">UPDATE_STATUS_PARSE_ERROR</code></td> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; ">The update information was malformed in some way.</td> </tr> <tr> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; "><code style="font: normal normal normal 100%/normal 'Courier New', 'Andale Mono', monospace; color: inherit; font-weight: inherit; ">UPDATE_STATUS_UNKNOWN_FORMAT</code></td> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; "> <p>The update was not in any known format.</p> </td> </tr> <tr> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; "><code style="font: normal normal normal 100%/normal 'Courier New', 'Andale Mono', monospace; color: inherit; font-weight: inherit; ">UPDATE_STATUS_SECURITY_ERROR</code></td> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; "> <p>The update information was not correctly signed or there was an SSL error.</p> </td> </tr> </tbody>
</table>
<h3>Auto update values</h3>
<table class="standard-table" style="font-size: 14px; margin-bottom: 1.286em; border-collapse: collapse; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; "> <tbody> <tr> <td class="header" style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); text-align: left; vertical-align: top; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); font-weight: bold; background-position: initial initial; background-repeat: initial initial; ">Constant</td> <td class="header" style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); text-align: left; vertical-align: top; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); font-weight: bold; background-position: initial initial; background-repeat: initial initial; ">Description</td> </tr> <tr> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; "><code style="font: normal normal normal 100%/normal 'Courier New', 'Andale Mono', monospace; color: inherit; font-weight: inherit; ">AUTOUPDATE_DISABLE</code></td> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; ">Indicates that the Addon should not update automatically.</td> </tr> <tr> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; "><code style="font: normal normal normal 100%/normal 'Courier New', 'Andale Mono', monospace; color: inherit; font-weight: inherit; ">AUTOUPDATE_DEFAULT</code></td> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; ">Indicates that the Addon should update automatically only if that's the global default.</td> </tr> <tr> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; "><code style="font: normal normal normal 100%/normal 'Courier New', 'Andale Mono', monospace; color: inherit; font-weight: inherit; ">AUTOUPDATE_ENABLE</code></td> <td style="font-family: inherit; font-size: inherit; color: inherit; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); text-align: left; vertical-align: top; ">Indicates that the Addon should update automatically.</td> </tr> </tbody>
</table>
<h3>Pending operations</h3>
<table class="standard-table"> <tbody> <tr> <td class="header">Constant</td> <td class="header">Description</td> </tr> <tr> <td><code>PENDING_NONE</code></td> <td>No operations are pending.</td> </tr> <tr> <td><code>PENDING_ENABLE</code></td> <td>This add-on will be enabled after the application restarts.</td> </tr> <tr> <td><code>PENDING_DISABLE</code></td> <td>This add-on will be disabled after the application restarts.</td> </tr> <tr> <td><code>PENDING_UNINSTALL</code></td> <td>This add-on will be uninstalled after the application restarts.</td> </tr> <tr> <td><code>PENDING_INSTALL</code></td> <td>This add-on will be installed after the application restarts.</td> </tr> <tr> <td><code>PENDING_UPGRADE</code></td> <td>This add-on will be upgraded after the application restarts.</td> </tr> </tbody>
</table>
<h3>Permissions</h3>
<table class="standard-table"> <tbody> <tr> <td class="header">Constant</td> <td class="header">Description</td> </tr> <tr> <td><code>PERM_CAN_UNINSTALL</code></td> <td>This add-on can be uninstalled.</td> </tr> <tr> <td><code>PERM_CAN_ENABLE</code></td> <td>This add-on can be enabled.</td> </tr> <tr> <td><code>PERM_CAN_DISABLE</code></td> <td>This add-on can be disabled.</td> </tr> <tr> <td><code>PERM_CAN_UPGRADE</code></td> <td>This add-on can be upgraded.</td> </tr> </tbody>
</table>
<h3>Operations requiring restart</h3>
<table class="standard-table"> <tbody> <tr> <td class="header">Constant</td> <td class="header">Description</td> </tr> <tr> <td><code>OP_NEEDS_RESTART_NONE</code></td> <td>No operations will require a restart.</td> </tr> <tr> <td><code>OP_NEEDS_RESTART_ENABLE</code></td> <td>Enabling the add-on will require a restart.</td> </tr> <tr> <td><code>OP_NEEDS_RESTART_DISABLE</code></td> <td>Disabling the add-on will require a restart.</td> </tr> <tr> <td><code>OP_NEEDS_RESTART_UNINSTALL</code></td> <td>Uninstalling the add-on will require a restart.</td> </tr> <tr> <td><code>OP_NEEDS_RESTART_INSTALL</code></td> <td>Installing the add-on will require a restart.</td> </tr> </tbody>
</table>
<h3>Installation scopes</h3>
<table class="standard-table"> <tbody> <tr> <td class="header">Constant</td> <td class="header">Description</td> </tr> <tr> <td><code>SCOPE_ALL</code></td> <td>A combination of all the installation scopes.</td> </tr> <tr> <td><code>SCOPE_APPLICATION</code></td> <td>This add-on is a part of the current application.</td> </tr> <tr> <td><code>SCOPE_PROFILE</code></td> <td>This add-on is installed in the current profile directory.</td> </tr> <tr> <td><code>SCOPE_SYSTEM</code></td> <td>This add-on is installed somewhere global to the system.</td> </tr> <tr> <td><code>SCOPE_USER</code></td> <td>This add-on is installed somewhere specific to the current user.</td> </tr> </tbody>
</table>
<div class="note"><strong>Note:</strong> The <code>extensions.enabledScopes</code> preference lets you configure which of these scopes are enabled; however, you can't turn off the profile scope.</div>
<h3>AddonType viewTypes{{ gecko_minversion_inline("6") }}</h3>
<table class="standard-table"> <tbody> <tr> <td class="header">Constant</td> <td class="header">Description</td> </tr> <tr> <td><code>VIEW_TYPE_LIST</code></td> <td>The type should be displayed in a regular list view in the UI.</td> </tr> </tbody>
</table>
<h3>AddonType flags{{ gecko_minversion_inline("6") }}</h3>
<table class="standard-table"> <tbody> <tr> <td class="header">Constant</td> <td class="header">Description</td> </tr> <tr> <td><code>TYPE_UI_HIDE_EMPTY</code></td> <td>The type should be hidden from the UI if no add-ons of that type are currently installed.</td> </tr> </tbody>
</table>
<h2>Methods</h2>
<h3>getInstallForURL()</h3>
<p>Asynchronously gets an {{ AMInterface("AddonInstall") }} for a URL.</p>
<pre>void getInstallForURL(
  in string url,
  in <a href="#InstallCallback()">InstallCallback</a> callback,
  in string mimetype,
  in string hash,
  in string name,
  in string iconURL,
  in string version,
  in {{Interface("nsILoadGroup")}} loadGroup
)</pre>
<h6>Parameters</h6>
<dl> <dt>url</dt> <dd>The url the add-on is located at</dd> <dt>callback</dt> <dd>A callback to pass the {{ AMInterface("AddonInstall") }} to</dd> <dt>mimetype</dt> <dd>The mimetype of the add-on</dd> <dt>hash</dt> <dd>An optional hash of the add-on</dd> <dt>name</dt> <dd>An optional placeholder name while the add-on is being downloaded</dd> <dt>iconURL</dt> <dd>An optional placeholder icon URL while the add-on is being downloaded</dd> <dt>version</dt> <dd>An optional placeholder version while the add-on is being downloaded</dd> <dt>loadGroup</dt> <dd>An optional {{ Interface("nsILoadGroup") }} to associate any network requests with</dd>
</dl>
<h3>getInstallForFile()</h3>
<p>Asynchronously gets an {{ AMInterface("AddonInstall") }} for an {{ Interface("nsIFile") }}.</p>
<pre>void getInstallForFile(
  in {{Interface("nsIFile")}} file,
  in <a href="#InstallCallback()">InstallCallback</a> callback,
  in string mimetype
)</pre>
<h6>Parameters</h6>
<dl> <dt>file</dt> <dd>the {{ Interface("nsIFile") }} where the add-on is located</dd> <dt>callback</dt> <dd>A callback to pass the {{ AMInterface("AddonInstall") }} to</dd> <dt>mimetype</dt> <dd>An optional mimetype hint for the add-on</dd>
</dl>
<h3>getAllInstalls()</h3>
<p>Asynchronously gets all current {{ AMInterface("AddonInstall") }}s.</p>
<pre>void getAllInstalls(
  in <a href="#InstallListCallback()">InstallListCallback</a> callback
)</pre>
<h6>Parameters</h6>
<dl> <dt>callback</dt> <dd>A callback which will be passed an array of {{ AMInterface("AddonInstall") }}s</dd>
</dl>
<h3>getInstallsByTypes()</h3>
<p>Asynchronously gets all current {{ AMInterface("AddonInstall") }}s optionally limiting to a list of types.</p>
<pre>void getInstallsByTypes(
  in string types[],
  in <a href="#InstallListCallback()">InstallListCallback</a> callback
)</pre>
<h6>Parameters</h6>
<dl> <dt>types</dt> <dd>An optional array of types to retrieve. Each type is a string name</dd> <dt>callback</dt> <dd>A callback which will be passed an array of {{ AMInterface("AddonInstall") }}s</dd>
</dl>
<h3>installAddonsFromWebpage()</h3>
<p>Starts installation of an array of {{ AMInterface("AddonInstall") }}s notifying the registered web install listener of blocked or started installs.</p>
<pre>void installAddonsFromWebpage(
  in string mimetype,
  in {{Interface("nsIDOMWindow")}} source,
  in {{Interface("nsIURI")}} uri,
  in {{AMInterface("AddonInstall")}} installs[]
)</pre>
<h6>Parameters</h6>
<dl> <dt>mimetype</dt> <dd>The mimetype of add-ons being installed</dd> <dt>source</dt> <dd>The {{ Interface("nsIDOMWindow") }} that started the installs</dd> <dt>uri</dt> <dd>the {{ Interface("nsIURI") }} that started the installs</dd> <dt>installs</dt> <dd>The array of {{ AMInterface("AddonInstall") }}s to be installed</dd>
</dl>
<h3>addInstallListener()</h3>
<p>Adds a new {{ AMInterface("InstallListener") }} if the listener is not already registered.</p>
<pre>void addInstallListener(
  in {{AMInterface("InstallListener")}} listener
)</pre>
<h6>Parameters</h6>
<dl> <dt>listener</dt> <dd>The {{ AMInterface("InstallListener") }} to add</dd>
</dl>
<h3>removeInstallListener()</h3>
<p>Removes an {{ AMInterface("InstallListener") }} if the listener is registered.</p>
<pre>void removeInstallListener(
  in {{AMInterface("InstallListener")}} listener
)</pre>
<h6>Parameters</h6>
<dl> <dt>listener</dt> <dd>The {{ AMInterface("InstallListener") }} to remove</dd>
</dl>
<h3>getAllAddons()</h3>
<p>Asynchronously gets all installed {{ AMInterface("Addon") }}s.</p>
<pre>void getAllAddons(
  in <a href="#AddonListCallback()">AddonListCallback</a> callback
)</pre>
<h6>Parameters</h6>
<dl> <dt>callback</dt> <dd>A callback which will be passed an array of {{ AMInterface("Addon") }}s</dd>
</dl>
<h3>getAddonByID()</h3>
<p>Asynchronously gets an {{ AMInterface("Addon") }} with a specific ID.</p>
<pre>void getAddonByID(
  in string id,
  in <a href="#AddonCallback()">AddonCallback</a> callback
)</pre>
<h6>Parameters</h6>
<dl> <dt>id</dt> <dd>The ID of the {{ AMInterface("Addon") }} to retrieve</dd> <dt>callback</dt> <dd>The callback to pass the retrieved {{ AMInterface("Addon") }} to</dd>
</dl>
<h3>getAddonsByIDs()</h3>
<p>Asynchronously gets an array of {{ AMInterface("Addon") }}s.</p>
<pre>void getAddonsByIDs(
  in string ids[],
  in <a href="#AddonListCallback()">AddonListCallback</a> callback
)</pre>
<h6>Parameters</h6>
<dl> <dt>ids</dt> <dd>The array of IDs to retrieve</dd> <dt>callback</dt> <dd>The callback to pass an array of {{ AMInterface("Addon") }}s to</dd>
</dl>
<h3>getAddonsByTypes()</h3>
<p>Asynchronously gets {{ AMInterface("Addon") }}s of specific types.</p>
<pre>void getAddonsByTypes(
  in string types[],
  in <a href="#AddonListCallback()">AddonListCallback</a> callback
)</pre>
<h6>Parameters</h6>
<dl> <dt>types</dt> <dd>An optional array of types to retrieve. Each type is a string name</dd> <dt>callback</dt> <dd>The callback to pass an array of {{ AMInterface("Addon") }}s to</dd>
</dl>
<h3>getAddonsWithOperationsByTypes()</h3>
<p>Asynchronously gets {{ AMInterface("Addon") }}s that have operations waiting for an application restart to complete.</p>
<pre>void getAddonsWithOperationsByTypes(
  in string types[],
  in <a href="#AddonListCallback()">AddonListCallback</a> callback
)</pre>
<h6>Parameters</h6>
<dl> <dt>types</dt> <dd>An optional array of types to retrieve. Each type is a string name</dd> <dt>callback</dt> <dd>The callback to pass the array of {{ AMInterface("Addon") }}s to</dd>
</dl>
<h3>addAddonListener()</h3>
<p>Adds a new {{ AMInterface("AddonListener") }} if the listener is not already registered.</p>
<pre>void addAddonListener(
  in {{AMInterface("AddonListener")}} listener
)</pre>
<h6>Parameters</h6>
<dl> <dt>listener</dt> <dd>The {{ AMInterface("AddonListener") }} to add</dd>
</dl>
<h3>removeAddonListener()</h3>
<p>Removes an {{ AMInterface("AddonListener") }} if the listener is registered.</p>
<pre>void removeAddonListener(
  in {{AMInterface("AddonListener")}} listener
)</pre>
<h6>Parameters</h6>
<dl> <dt>listener</dt> <dd>The {{ AMInterface("AddonListener") }} to remove</dd>
</dl>
<h3>addTypeListener(){{ gecko_minversion_inline("6") }}</h3>
<p>Adds a new {{ AMInterface("TypeListener") }} if the listener is not already registered.</p>
<pre>void addTypeListener(
  in {{AMInterface("TypeListener")}} listener
)</pre>
<h6>Parameters</h6>
<dl> <dt>listener</dt> <dd>The {{ AMInterface("TypeListener") }} to add</dd>
</dl>
<h3>removeTypeListener(){{ gecko_minversion_inline("6") }}</h3>
<p>Removes a {{ AMInterface("TypeListener") }} if the listener is registered.</p>
<pre>void removeTypeListener(
  in {{AMInterface("TypeListener")}} listener
)</pre>
<h6>Parameters</h6>
<dl> <dt>listener</dt> <dd>The {{ AMInterface("TypeListener") }} to remove</dd>
</dl>
Revert to this revision