mozilla

Revision 363293 of AddonManager

  • Revision slug: Addons/Add-on_Manager/AddonManager
  • Revision title: AddonManager
  • Revision id: 363293
  • Created:
  • Creator: darktrojan
  • Is current revision? No
  • Comment

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 {{ source("toolkit/mozapps/extensions/XPIProvider.jsm","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 getAddonBySyncGUID(in string id, in AddonCallback callback) {{ gecko_minversion_inline("11.0") }}
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.0") }}
void removeTypeListener(in {{ AMInterface("TypeListener") }} listener){{ gecko_minversion_inline("6.0") }}
{{ Interface("nsIURI") }} getURIForResourceInFile(in {{ Interface("nsIFile") }} aFile, in string aPath) {{ gecko_minversion_inline("7.0") }}

Properties Overview

Attribute Type Description
addonTypes dictionary A dictionary that maps type ID to {{ AMInterface("AddonType") }}.
autoUpdateDefault boolean Whether addons should auto-update by default (overrideable per addon). Corresponds to the extensions.autoUpdateDefault preference.

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 canceled.

AddonInstall errors

Constant Description
ERROR_NETWORK_FAILURE A network error occurred.
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 Value Description
SCOPE_ALL 15 A combination of all the installation scopes.
SCOPE_APPLICATION 4 This add-on is a part of the current application.
SCOPE_PROFILE 1 This add-on is installed in the current profile directory.
SCOPE_SYSTEM 8 This add-on is installed somewhere global to the system.
SCOPE_USER 2 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. Starting in Firefox 8 {{ geckoRelease("8.0") }}, you can also set the value of the preference extensions.autoDisabledScopes to prevent Firefox from automatically installing add-ons from the specified scopes.

{{ h2_gecko_minversion("AddonType viewTypes", "6.0") }}

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

{{ h2_gecko_minversion("AddonType flags", "6.0") }}

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

{{ h2_gecko_minversion("Startup change types", "7.0") }}

These constants represent the lists of types of changes that can occur to add-ons during startup; they're used with the {{ manch("getStartupChanges") }}, {{ manch("addStartupChange") }}, and {{ manch("removeStartupChange") }} methods.

Constant Description
STARTUP_CHANGE_INSTALLED A list of add-ons that were detected as newly-installed during application startup. This doesn't include add-ons that were awaiting installation the last time the application was running.
STARTUP_CHANGE_CHANGED A list of add-ons that were detected as having changed during startup. This includes an add-on being moved to a new location, changing version, or having been detected as possibly altered.
STARTUP_CHANGE_UNINSTALLED A list of add-ons that were detected as having been uninstalled during startup. This doesn't include add-ons for which uninstall was pending the last time the application was running.
STARTUP_CHANGE_DISABLED A list of add-ons that were detected as having become disabled during startup. This normally means the application determined that the add-on is incompatible. This doesn't include add-ons that were pending becoming disabled the last time the application was running.
STARTUP_CHANGE_ENABLED A list of add-ons that were detected as having become enabled during startup. This normally means the application determined that an application change has made the add-on compatible. This doesn't include add-ons that were pending becomingenabled  the last time the application was running.

Methods

{{ method_gecko_minversion("addStartupChange", "7.0") }}

Adds an add-on change from the add-on changes list. This is used to build the lists of changed add-ons reported by the {{ manch("getStartupChanges") }} method.

Note: Calling this method more than once for the same add-on will replace the last change that was recorded with the new one; an add-on can only appear once across all change types.
void addStartupChange(
  in string changeType,
  in string id
); 
Parameters
changeType
The type of change that occurred for the specified add-on. This can be one of the {{ anch("Startup change types") }} or a custom value defined by your own provider.
id
The add-on ID to add to the change list.

{{ method_gecko_minversion("removeStartupChange", "7.0") }}

Removes an add-on from the add-on changes list.

void addStartupChange(
  in string changeType,
  in string id
);
Parameters
changeType
The type of change to remove for the specified add-on. This can be one of the {{ anch("Startup change types") }} or a custom value defined by your own provider.
id
The add-on ID to remove from the change list.

{{ method_gecko_minversion("getStartupChanges", "7.0") }}

Returns an array of add-on IDs that changed for a given startup change type.

string[] getStartupChanges(
  in string changeType
); 
Parameters
changeType
The change type for which to retrieve a list of changed add-ons. This can be one of the {{ anch("Startup change types") }} or a custom value defined by your own provider.
Return value

An array of add-on IDs indicating the add-ons for which the specified change type applies.

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

{{ method_gecko_minversion("getAddonBySyncGUID", "11.0") }}

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

void getAddonBySyncGUID(
  in string guid,
  in AddonCallback callback
)
Parameters
guid
The Sync GUID 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()

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()

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

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

getURIForResourceInFile()

{{ Interface("nsIURI") }} getURIForResourceInFile(
  in {{ Interface("nsIFile") }} aFile,
  in string aPath
)
Parameters
aFile
The {{ Interface("nsIFile") }} containing the resources, must be either a directory or an XPI file.
aPath
The path to find the resource at, "/" separated. If aPath is empty then the URI to the root of the contained files will be returned.
Returns

An {{ Interface("nsIURI") }} pointing at the resource.

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 {{ source("toolkit/mozapps/extensions/XPIProvider.jsm","XPIProvider.jsm") }} and are, at this time, the following: <code>extension</code>, <code>theme</code>, <code>locale</code>, <code>multipackage</code>.</p>
<p>To import the AddonManager object, use:</p>
<pre>
Components.utils.import("resource://gre/modules/AddonManager.jsm");
</pre>
<h2 id="Method_Overview">Method Overview</h2>
<table class="standard-table">
  <tbody>
    <tr>
      <td><code>void <a href="#getInstallForURL()" style="">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()" style="">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()" style="">getAddonByID</a>(in string id, in <a href="#AddonCallback()">AddonCallback</a> callback)</code></td>
    </tr>
    <tr>
      <td><code>void <a href="#getAddonBySyncGUID()" style="">getAddonBySyncGUID</a>(in string id, in <a href="#AddonCallback()">AddonCallback</a> callback) </code>{{ gecko_minversion_inline("11.0") }}</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.0") }}</td>
    </tr>
    <tr>
      <td><code>void <a href="#removeTypeListener()">removeTypeListener</a>(in {{ AMInterface("TypeListener") }} listener)</code>{{ gecko_minversion_inline("6.0") }}</td>
    </tr>
    <tr>
      <td><code>{{ Interface("nsIURI") }} <a href="#getURIForResourceInFile()">getURIForResourceInFile</a>(in {{ Interface("nsIFile") }} aFile, in string aPath)</code> {{ gecko_minversion_inline("7.0") }}</td>
    </tr>
  </tbody>
</table>
<h2 id="Properties_Overview">Properties Overview</h2>
<table class="standard-table">
  <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>
    <tr>
      <td><code>autoUpdateDefault</code></td>
      <td><code>boolean</code></td>
      <td>Whether addons should auto-update by default (overrideable per addon). Corresponds to the <code>extensions.autoUpdateDefault</code> preference.</td>
    </tr>
  </tbody>
</table>
<h2 id="Callbacks">Callbacks</h2>
<h3 id="InstallCallback()">InstallCallback()</h3>
<p>A callback that is passed a single {{ AMInterface("AddonInstall") }}</p>
<pre class="eval">
void InstallCallback(
  in {{ AMInterface("AddonInstall") }} install
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    install</dt>
  <dd>
    The {{ AMInterface("AddonInstall") }} passed back from the asynchronous request</dd>
</dl>
<h3 id="InstallListCallback()">InstallListCallback()</h3>
<p>A callback that is passed an array of {{ AMInterface("AddonInstall") }}s</p>
<pre class="eval">
void InstallListCallback(
  in {{ AMInterface("AddonInstall") }} installs[]
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    installs</dt>
  <dd>
    The array of {{ AMInterface("AddonInstall") }}s passed back from the asynchronous request</dd>
</dl>
<h3 id="AddonCallback()">AddonCallback()</h3>
<p>A callback that is passed a single {{ AMInterface("Addon") }}</p>
<pre class="eval">
void AddonCallback(
  in {{ AMInterface("Addon") }} addon
)</pre>
<h6 id="Parameters">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>null</code> is passed back instead.</dd>
</dl>
<h3 id="AddonListCallback()">AddonListCallback()</h3>
<p>A callback that is passed an array of {{ AMInterface("Addon") }}s</p>
<pre class="eval">
void AddonListCallback(
  in {{ AMInterface("Addon") }} addons[]
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    addons</dt>
  <dd>
    The array of {{ AMInterface("Addon") }}s passed back from the asynchronous request</dd>
</dl>
<h2 id="Constants">Constants</h2>
<h3 id="AddonInstall_states">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 canceled.</td>
    </tr>
  </tbody>
</table>
<h3 id="AddonInstall_errors">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 occurred.</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 id="Update_check_reasons">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 id="Update_status_values">Update status values</h3>
<table class="standard-table">
  <tbody>
    <tr>
      <td class="header">Constant</td>
      <td class="header">Description</td>
    </tr>
    <tr>
      <td><code>UPDATE_STATUS_NO_ERROR</code></td>
      <td>No error was encountered.</td>
    </tr>
    <tr>
      <td><code>UPDATE_STATUS_TIMEOUT</code></td>
      <td>The update check timed out.</td>
    </tr>
    <tr>
      <td><code>UPDATE_STATUS_DOWNLOAD_ERROR</code></td>
      <td>There was an error while downloading the update information.</td>
    </tr>
    <tr>
      <td><code>UPDATE_STATUS_PARSE_ERROR</code></td>
      <td>The update information was malformed in some way.</td>
    </tr>
    <tr>
      <td><code>UPDATE_STATUS_UNKNOWN_FORMAT</code></td>
      <td>The update was not in any known format.</td>
    </tr>
    <tr>
      <td><code>UPDATE_STATUS_SECURITY_ERROR</code></td>
      <td>The update information was not correctly signed or there was an SSL error.</td>
    </tr>
  </tbody>
</table>
<h3 id="Auto_update_values">Auto update values</h3>
<table class="standard-table">
  <tbody>
    <tr>
      <td class="header">Constant</td>
      <td class="header">Description</td>
    </tr>
    <tr>
      <td><code>AUTOUPDATE_DISABLE</code></td>
      <td>Indicates that the Addon should not update automatically.</td>
    </tr>
    <tr>
      <td><code>AUTOUPDATE_DEFAULT</code></td>
      <td>Indicates that the Addon should update automatically only if that's the global default.</td>
    </tr>
    <tr>
      <td><code>AUTOUPDATE_ENABLE</code></td>
      <td>Indicates that the Addon should update automatically.</td>
    </tr>
  </tbody>
</table>
<h3 id="Pending_operations">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 id="Permissions">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 id="Operations_requiring_restart">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 id="Installation_scopes">Installation scopes</h3>
<table class="standard-table">
  <tbody>
    <tr>
      <td class="header">Constant</td>
      <td class="header">Value</td>
      <td class="header">Description</td>
    </tr>
    <tr>
      <td><code>SCOPE_ALL</code></td>
      <td>15</td>
      <td>A combination of all the installation scopes.</td>
    </tr>
    <tr>
      <td><code>SCOPE_APPLICATION</code></td>
      <td>4</td>
      <td>This add-on is a part of the current application.</td>
    </tr>
    <tr>
      <td><code>SCOPE_PROFILE</code></td>
      <td>1</td>
      <td>This add-on is installed in the current profile directory.</td>
    </tr>
    <tr>
      <td><code>SCOPE_SYSTEM</code></td>
      <td>8</td>
      <td>This add-on is installed somewhere global to the system.</td>
    </tr>
    <tr>
      <td><code>SCOPE_USER</code></td>
      <td>2</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. Starting in Firefox 8 {{ geckoRelease("8.0") }}, you can also set the value of the preference <code>extensions.autoDisabledScopes</code> to prevent Firefox from automatically installing add-ons from the specified scopes.</div>
<p>{{ h2_gecko_minversion("AddonType viewTypes", "6.0") }}</p>
<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>
<p>{{ h2_gecko_minversion("AddonType flags", "6.0") }}</p>
<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>
<p>{{ h2_gecko_minversion("Startup change types", "7.0") }}</p>
<p>These constants represent the lists of types of changes that can occur to add-ons during startup; they're used with the {{ manch("getStartupChanges") }}, {{ manch("addStartupChange") }}, and {{ manch("removeStartupChange") }}&nbsp;methods.</p>
<table class="standard-table">
  <tbody>
    <tr>
      <td class="header">Constant</td>
      <td class="header">Description</td>
    </tr>
    <tr>
      <td><code>STARTUP_CHANGE_INSTALLED</code></td>
      <td>A list of add-ons that were detected as newly-installed during application startup. This doesn't include add-ons that were awaiting installation the last time the application was running.</td>
    </tr>
    <tr>
      <td><code>STARTUP_CHANGE_CHANGED</code></td>
      <td>A list of add-ons that were detected as having changed during startup. This includes an add-on being moved to a new location, changing version, or having been detected as possibly altered.</td>
    </tr>
    <tr>
      <td><code>STARTUP_CHANGE_UNINSTALLED</code></td>
      <td>A list of add-ons that were detected as having been uninstalled during startup. This doesn't include add-ons for which uninstall was pending the last time the application was running.</td>
    </tr>
    <tr>
      <td><code>STARTUP_CHANGE_DISABLED</code></td>
      <td>A list of add-ons that were detected as having become disabled during startup. This normally means the application determined that the add-on is incompatible. This doesn't include add-ons that were pending becoming disabled the last time the application was running.</td>
    </tr>
    <tr>
      <td><code>STARTUP_CHANGE_ENABLED</code></td>
      <td>A list of add-ons that were detected as having become enabled during startup. This normally means the application determined that an application change has made the add-on compatible. This doesn't include add-ons that were pending becomingenabled&nbsp; the last time the application was running.</td>
    </tr>
  </tbody>
</table>
<h2 id="Methods">Methods</h2>
<p>{{ method_gecko_minversion("addStartupChange", "7.0") }}</p>
<p>Adds an add-on change from the add-on changes list. This is used to build the lists of changed add-ons reported by the {{ manch("getStartupChanges") }} method.</p>
<div class="note">
  <strong>Note:</strong> Calling this method more than once for the same add-on will replace the last change that was recorded with the new one; an add-on can only appear once across all change types.</div>
<pre>
void addStartupChange(
&nbsp; in string changeType,
&nbsp; in string id
); 
</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    <code>changeType</code></dt>
  <dd>
    The type of change that occurred for the specified add-on. This can be one of the {{ anch("Startup change types") }}&nbsp;or a custom value defined by your own provider.</dd>
  <dt>
    <code>id</code></dt>
  <dd>
    The add-on ID to add to the change list.</dd>
</dl>
<p>{{ method_gecko_minversion("removeStartupChange", "7.0") }}</p>
<p>Removes an add-on from the add-on changes list.</p>
<pre>
void addStartupChange(
&nbsp; in string changeType,
&nbsp; in string id
);
</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    <code>changeType</code></dt>
  <dd>
    The type of change to remove for the specified add-on. This can be one of the {{ anch("Startup change types") }}&nbsp;or a custom value defined by your own provider.</dd>
  <dt>
    <code>id</code></dt>
  <dd>
    The add-on ID to remove from the change list.</dd>
</dl>
<p>{{ method_gecko_minversion("getStartupChanges", "7.0") }}</p>
<p>Returns an array of add-on IDs that changed for a given startup change type.</p>
<pre>
string[] getStartupChanges(
&nbsp; in string changeType
); 
</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    <code>changeType</code></dt>
  <dd>
    The change type for which to retrieve a list of changed add-ons. This can be one of the {{ anch("Startup change types") }}&nbsp;or a custom value defined by your own provider.</dd>
</dl>
<h6 id="Return_value">Return value</h6>
<p>An array of add-on IDs indicating the add-ons for which the specified change type applies.</p>
<h3 id="getInstallForURL()">getInstallForURL()</h3>
<p>Asynchronously gets an {{ AMInterface("AddonInstall") }} for a URL.</p>
<pre class="eval">
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 id="Parameters">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 id="getInstallForFile()">getInstallForFile()</h3>
<p>Asynchronously gets an {{ AMInterface("AddonInstall") }} for an {{ Interface("nsIFile") }}.</p>
<pre class="eval">
void getInstallForFile(
  in {{ Interface("nsIFile") }} file,
  in <a href="#InstallCallback()">InstallCallback</a> callback,
  in string mimetype
)
</pre>
<h6 id="Parameters">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 id="getAllInstalls()">getAllInstalls()</h3>
<p>Asynchronously gets all current {{ AMInterface("AddonInstall") }}s.</p>
<pre class="eval">
void getAllInstalls(
  in <a href="#InstallListCallback()">InstallListCallback</a> callback
)
</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    callback</dt>
  <dd>
    A callback which will be passed an array of {{ AMInterface("AddonInstall") }}s</dd>
</dl>
<h3 id="getInstallsByTypes()">getInstallsByTypes()</h3>
<p>Asynchronously gets all current {{ AMInterface("AddonInstall") }}s optionally limiting to a list of types.</p>
<pre class="eval">
void getInstallsByTypes(
  in string types[],
  in <a href="#InstallListCallback()">InstallListCallback</a> callback
)
</pre>
<h6 id="Parameters">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 id="installAddonsFromWebpage()">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 class="eval">
void installAddonsFromWebpage(
  in string mimetype,
  in {{ Interface("nsIDOMWindow") }} source,
  in {{ Interface("nsIURI") }} uri,
  in {{ AMInterface("AddonInstall") }} installs[]
)
</pre>
<h6 id="Parameters">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 id="addInstallListener()">addInstallListener()</h3>
<p>Adds a new {{ AMInterface("InstallListener") }} if the listener is not already registered.</p>
<pre class="eval">
void addInstallListener(
  in {{ AMInterface("InstallListener") }} listener
)
</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    listener</dt>
  <dd>
    The {{ AMInterface("InstallListener") }} to add</dd>
</dl>
<h3 id="removeInstallListener()">removeInstallListener()</h3>
<p>Removes an {{ AMInterface("InstallListener") }} if the listener is registered.</p>
<pre class="eval">
void removeInstallListener(
  in {{ AMInterface("InstallListener") }} listener
)
</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    listener</dt>
  <dd>
    The {{ AMInterface("InstallListener") }} to remove</dd>
</dl>
<h3 id="getAllAddons()">getAllAddons()</h3>
<p>Asynchronously gets all installed {{ AMInterface("Addon") }}s.</p>
<pre class="eval">
void getAllAddons(
  in <a href="#AddonListCallback()">AddonListCallback</a> callback
)
</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    callback</dt>
  <dd>
    A callback which will be passed an array of {{ AMInterface("Addon") }}s</dd>
</dl>
<h3 id="getAddonByID()">getAddonByID()</h3>
<p>Asynchronously gets an {{ AMInterface("Addon") }} with a specific ID.</p>
<pre class="eval">
void getAddonByID(
  in string id,
  in <a href="#AddonCallback()">AddonCallback</a> callback
)
</pre>
<h6 id="Parameters">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>
<p>{{ method_gecko_minversion("getAddonBySyncGUID", "11.0") }}</p>
<p>Asynchronously gets an {{ AMInterface("Addon") }} with a specific Sync GUID.</p>
<pre class="eval">
void getAddonBySyncGUID(
  in string guid,
  in <a href="#AddonCallback()">AddonCallback</a> callback
)
</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    <code>guid</code></dt>
  <dd>
    The Sync GUID of the {{ AMInterface("Addon") }} to retrieve</dd>
  <dt>
    <code>callback</code></dt>
  <dd>
    The callback to pass the retrieved {{ AMInterface("Addon") }} to</dd>
</dl>
<h3 id="getAddonsByIDs()">getAddonsByIDs()</h3>
<p>Asynchronously gets an array of {{ AMInterface("Addon") }}s.</p>
<pre class="eval">
void getAddonsByIDs(
  in string ids[],
  in <a href="#AddonListCallback()">AddonListCallback</a> callback
)
</pre>
<h6 id="Parameters">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 id="getAddonsByTypes()">getAddonsByTypes()</h3>
<p>Asynchronously gets {{ AMInterface("Addon") }}s of specific types.</p>
<pre class="eval">
void getAddonsByTypes(
  in string types[],
  in <a href="#AddonListCallback()">AddonListCallback</a> callback
)
</pre>
<h6 id="Parameters">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 id="getAddonsWithOperationsByTypes()">getAddonsWithOperationsByTypes()</h3>
<p>Asynchronously gets {{ AMInterface("Addon") }}s that have operations waiting for an application restart to complete.</p>
<pre class="eval">
void getAddonsWithOperationsByTypes(
  in string types[],
  in <a href="#AddonListCallback()">AddonListCallback</a> callback
)
</pre>
<h6 id="Parameters">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 id="addAddonListener()">addAddonListener()</h3>
<p>Adds a new {{ AMInterface("AddonListener") }} if the listener is not already registered.</p>
<pre class="eval">
void addAddonListener(
  in {{ AMInterface("AddonListener") }} listener
)
</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    listener</dt>
  <dd>
    The {{ AMInterface("AddonListener") }} to add</dd>
</dl>
<h3 id="removeAddonListener()">removeAddonListener()</h3>
<p>Removes an {{ AMInterface("AddonListener") }} if the listener is registered.</p>
<pre class="eval">
void removeAddonListener(
  in {{ AMInterface("AddonListener") }} listener
)
</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    listener</dt>
  <dd>
    The {{ AMInterface("AddonListener") }} to remove</dd>
</dl>
<h3 id="addTypeListener()">addTypeListener()</h3>
<p>Adds a new {{ AMInterface("TypeListener") }} if the listener is not already registered.</p>
<pre class="eval">
void addTypeListener(
  in {{ AMInterface("TypeListener") }} listener
)
</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    listener</dt>
  <dd>
    The {{ AMInterface("TypeListener") }} to add</dd>
</dl>
<h3 id="removeTypeListener()">removeTypeListener()</h3>
<p>Removes a {{ AMInterface("TypeListener") }} if the listener is registered.</p>
<pre class="eval">
void removeTypeListener(
  in {{ AMInterface("TypeListener") }} listener
)
</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    listener</dt>
  <dd>
    The {{ AMInterface("TypeListener") }} to remove</dd>
</dl>
<h3 id="getURIForResourceInFile()">getURIForResourceInFile()</h3>
<pre class="eval">
{{ Interface("nsIURI") }} getURIForResourceInFile(
  in {{ Interface("nsIFile") }} aFile,
  in string aPath
)
</pre>
<h6 id="Parameters">Parameters</h6>
<dl>
  <dt>
    aFile</dt>
  <dd>
    The {{ Interface("nsIFile") }} containing the resources, must be either a directory or an XPI file.</dd>
  <dt>
    aPath</dt>
  <dd>
    The path to find the resource at, "/" separated. If <code>aPath</code> is empty then the URI to the root of the contained files will be returned.</dd>
</dl>
<h6 id="Returns">Returns</h6>
<p>An {{ Interface("nsIURI") }} pointing at the resource.</p>
Revert to this revision