Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

InstallListener

This article needs a technical review. How you can help.

InstallListeners are notified of an AddonInstall's progress. They may be registered to hear events from all AddonInstalls through AddonManager.addInstallListener() or to a single AddonInstall through AddonInstall.addListener().

Method Overview

void onNewInstall(in AddonInstall install)
void onDownloadStarted(in AddonInstall install)
void onDownloadProgress(in AddonInstall install)
void onDownloadEnded(in AddonInstall install)
void onDownloadCancelled(in AddonInstall install)
void onDownloadFailed(in AddonInstall install)
void onInstallStarted(in AddonInstall install)
void onInstallEnded(in AddonInstall install, in Addon addon)
void onInstallCancelled(in AddonInstall install)
void onInstallFailed(in AddonInstall install)
void onExternalInstall(in Addon install, in Addon existingAddon, in boolean needsRestart)

Methods

onNewInstall()

Called when a new instance of AddonInstall is created, primarily so UI can display some kind of progress for all installs.

void onNewInstall(
  in AddonInstall install
)
Parameters
install
The AddonInstall representing the install

onDownloadStarted()

Called when downloading begins for an add-on install. Only called for add-ons that need to be downloaded. A listener may return false to cancel the download.

void onDownloadStarted(
  in AddonInstall install
)
Parameters
install
The AddonInstall representing the install

onDownloadProgress()

Called as data is received during a download. Check the AddonInstall.progress() property for the amount of data downloaded and the AddonInstall.maxProgress() property for the total data expected. A listener may return false to cancel the download.

void onDownloadProgress(
  in AddonInstall install
)
Parameters
install
The AddonInstall representing the install

onDownloadEnded()

Called when downloading completes successfully for an add-on install. Only called for add-ons that need to be downloaded.

void onDownloadEnded(
  in AddonInstall install
)
Parameters
install
The AddonInstall representing the install

onDownloadCancelled()

Called when downloading is cancelled. Only called for add-ons that need to be downloaded.

void onDownloadCancelled(
  in AddonInstall install
)
Parameters
install
The AddonInstall representing the install

onDownloadFailed()

Called if there is some error downloading the add-on. Only called for add-ons that need to be downloaded.

void onDownloadFailed(
  in AddonInstall install
)
Parameters
install
The AddonInstall representing the install

onInstallStarted()

Called when installation of an add-on begins. A listener may return false to cancel the install.

void onInstallStarted(
  in AddonInstall install
)
Parameters
install
The AddonInstall representing the install

onInstallEnded()

Called when installation of an add-on is complete. The newly installed add-on may require a restart in order to become active.

void onInstallEnded(
  in AddonInstall install
  in Addon addon
)
Parameters
install
The AddonInstall representing the install
addon
The Addon addon that has been installed

onInstallCancelled()

Called when installation is cancelled.

void onInstallCancelled(
  in AddonInstall install
)
Parameters
install
The AddonInstall representing the install

onInstallFailed()

Called when there is a failure installing the add-on.

void onInstallFailed(
  in AddonInstall install
)
Parameters
install
The AddonInstall representing the install

onExternalInstall()

Called when an add-on is installed through some system other than an AddonInstall.

void onExternalInstall(
  in Addon addon,
  in Addon existingAddon,
  in boolean needsRestart
)
Parameters
addon
The newly installed Addon
existingAddon
An Addon that will be replaced by this install or null if no add-on is being replaced
needsRestart
True if the installation requires a restart

Document Tags and Contributors

 Contributors to this page: kscarfone, Sheppy, trevorh, Yansky0, Mossop
 Last updated by: kscarfone,