Support for extensions using XUL/XPCOM or the Add-on SDK was removed in Firefox 57, released November 2017. As there is no supported version of Firefox enabling these technologies, this page will be removed by December 2020.

Add-ons using the techniques described in this document are considered a legacy technology in Firefox. Don't use these techniques to develop new add-ons. Use WebExtensions instead. If you maintain an add-on which uses the techniques described here, consider migrating it to use WebExtensions.

Starting from Firefox 53, no new legacy add-ons will be accepted on addons.mozilla.org (AMO) for desktop Firefox and Firefox for Android.

Starting from Firefox 57, only extensions developed using WebExtensions APIs will be supported on Desktop Firefox and Firefox for Android.

Even before Firefox 57, changes coming up in the Firefox platform will break many legacy extensions. These changes include multiprocess Firefox (e10s), sandboxing, and multiple content processes. Legacy extensions that are affected by these changes should migrate to use WebExtensions APIs if they can. See the "Compatibility Milestones" document for more information.

A wiki page containing resources, migration paths, office hours, and more, is available to help developers transition to the new technologies.

An AddonInstall instance tracks download and installation process of an add-on. Instances can be created using the getInstallForFile() or getInstallForURL() methods on the AddonManager. Once you have an instance the install() method is used to start automatic download and installation. This can be canceled at any time with the cancel() method.

Method Overview

void install()
void cancel()
void addListener(in InstallListener listener)
void removeListener(in InstallListener listener)

Properties

Attribute Type Description
name string The name of the add-on being installed.
version string The version of the add-on being installed.
iconURL string The icon of the add-on being installed.
releaseNotesURI nsIURI The URI of release notes for this install.
type string The type of the add-on being installed.
state integer The state of the installation.
error integer If an error has been encountered during the download or install this will hold the error code.
sourceURI nsIURI The URI that the add-on is being installed from.
file nsIFile The file that the add-on is being installed from. This may be null if the add-on is coming from the Internet and has yet to be downloaded.
progress integer The progress of any necessary downloads.
maxProgress integer The expected size of any necessary downloads or -1 if unknown.
certificate nsIX509Cert If the add-on to be installed is signed this is the certificate of the signer. Only available after downloading is complete.
certName string If the add-on to be installed is signed this is the simple display name of the signer.
existingAddon Addon The Addon that this install will update. May be null if it isn't updating anything installed. This is guaranteed to be correct after downloading is complete but may be set earlier.
addon Addon The full Addon that this install will install. Only available after downloading is complete.

Methods

install()

Starts or continues the install process. The process will continue in the background until it fails, completes, one of the registered InstallListeners pauses it, or the process is canceled by a call to the cancel() method.

void install(
)

cancel()

Cancels the install process, it cannot be restarted after this.

void cancel(
)

addListener()

Adds a new InstallListener if the listener is not already registered to monitor this specific AddonInstall.

void addListener(
  in InstallListener listener
)
Parameters
listener
The InstallListener to add.

removeListener()

Removes an InstallListener if the listener is registered for monitoring this specific AddonInstall.

void removeListener(
  in InstallListener listener
)
Parameters
listener
The InstallListener to remove