InstallListener

  • Revision slug: Mozilla/Add-ons/Add-on_Manager/InstallListener
  • Revision title: InstallListener
  • Revision id: 396497
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment Reverted to earlier version; 16 words removedMoved From Addons/Add-on_Manager/InstallListener to Mozilla/Add-ons/Add-on_Manager/InstallListener

Revision Content

{{ gecko_minversion_header("2.0") }}

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

Method Overview

void onNewInstall(in {{ AMInterface("AddonInstall") }} install)
void onDownloadStarted(in {{ AMInterface("AddonInstall") }} install)
void onDownloadProgress(in {{ AMInterface("AddonInstall") }} install)
void onDownloadEnded(in {{ AMInterface("AddonInstall") }} install)
void onDownloadCancelled(in {{ AMInterface("AddonInstall") }} install)
void onDownloadFailed(in {{ AMInterface("AddonInstall") }} install)
void onInstallStarted(in {{ AMInterface("AddonInstall") }} install)
void onInstallEnded(in {{ AMInterface("AddonInstall") }} install, in {{ AMInterface("Addon") }} addon)
void onInstallCancelled(in {{ AMInterface("AddonInstall") }} install)
void onInstallFailed(in {{ AMInterface("AddonInstall") }} install)
void onExternalInstall(in {{ AMInterface("Addon") }} install, in {{ AMInterface("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 {{AMInterface("AddonInstall")}} install
)
Parameters
install
The {{ AMInterface("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 {{AMInterface("AddonInstall")}} install
)
Parameters
install
The {{ AMInterface("AddonInstall") }} representing the install

onDownloadProgress()

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

void onDownloadProgress(
  in {{AMInterface("AddonInstall")}} install
)
Parameters
install
The {{ AMInterface("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 {{AMInterface("AddonInstall")}} install
)
Parameters
install
The {{ AMInterface("AddonInstall") }} representing the install

onDownloadCancelled()

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

void onDownloadCancelled(
  in {{AMInterface("AddonInstall")}} install
)
Parameters
install
The {{ AMInterface("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 {{AMInterface("AddonInstall")}} install
)
Parameters
install
The {{ AMInterface("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 {{AMInterface("AddonInstall")}} install
)
Parameters
install
The {{ AMInterface("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 {{AMInterface("AddonInstall")}} install
  in {{AMInterface("Addon")}} addon
)
Parameters
install
The {{ AMInterface("AddonInstall") }} representing the install
addon
The {{ AMInterface("Addon") }} addon that has been installed

onInstallCancelled()

Called when installation is cancelled.

void onInstallCancelled(
  in {{AMInterface("AddonInstall")}} install
)
Parameters
install
The {{ AMInterface("AddonInstall") }} representing the install

onInstallFailed()

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

void onInstallFailed(
  in {{AMInterface("AddonInstall")}} install
)
Parameters
install
The {{ AMInterface("AddonInstall") }} representing the install

onExternalInstall()

Called when an add-on is installed through some system other than an {{ AMInterface("AddonInstall") }}.

void onExternalInstall(
  in {{AMInterface("Addon")}} addon,
  in {{AMInterface("Addon")}} existingAddon,
  in boolean needsRestart
)
Parameters
addon
The newly installed {{ AMInterface("Addon") }}
existingAddon
An {{ AMInterface("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

Revision Source

<p>{{ gecko_minversion_header("2.0") }}</p>
<p>InstallListeners are notified of an {{ AMInterface("AddonInstall") }}'s progress. They may be registered to hear events from all {{ AMInterface("AddonInstall") }}s through {{ AMInterface("AddonManager","addInstallListener") }} or to a single {{ AMInterface("AddonInstall") }} through {{ AMInterface("AddonInstall","addListener") }}</p>
<h2 id="Method_Overview">Method Overview</h2>
<table class="standard-table"> <tbody> <tr> <td><code>void <a href="#onNewInstall()">onNewInstall</a>(in {{ AMInterface("AddonInstall") }} install)</code></td> </tr> <tr> <td><code>void <a href="#onDownloadStarted()">onDownloadStarted</a>(in {{ AMInterface("AddonInstall") }} install)</code></td> </tr> <tr> <td><code>void <a href="#onDownloadProgress()">onDownloadProgress</a>(in {{ AMInterface("AddonInstall") }} install)</code></td> </tr> <tr> <td><code>void <a href="#onDownloadEnded()">onDownloadEnded</a>(in {{ AMInterface("AddonInstall") }} install)</code></td> </tr> <tr> <td><code>void <a href="#onDownloadCancelled()">onDownloadCancelled</a>(in {{ AMInterface("AddonInstall") }} install)</code></td> </tr> <tr> <td><code>void <a href="#onDownloadFailed()">onDownloadFailed</a>(in {{ AMInterface("AddonInstall") }} install)</code></td> </tr> <tr> <td><code>void <a href="#onInstallStarted()">onInstallStarted</a>(in {{ AMInterface("AddonInstall") }} install)</code></td> </tr> <tr> <td><code>void <a href="#onInstallEnded()">onInstallEnded</a>(in {{ AMInterface("AddonInstall") }} install, in {{ AMInterface("Addon") }} addon)</code></td> </tr> <tr> <td><code>void <a href="#onInstallCancelled()">onInstallCancelled</a>(in {{ AMInterface("AddonInstall") }} install)</code></td> </tr> <tr> <td><code>void <a href="#onInstallFailed()">onInstallFailed</a>(in {{ AMInterface("AddonInstall") }} install)</code></td> </tr> <tr> <td><code>void <a href="#onExternalInstall()">onExternalInstall</a>(in {{ AMInterface("Addon") }} install, in {{ AMInterface("Addon") }} existingAddon, in boolean needsRestart)</code></td> </tr> </tbody>
</table>
<h2 id="Methods">Methods</h2>
<h3 id="onNewInstall()">onNewInstall()</h3>
<p>Called when a new instance of AddonInstall is created, primarily so UI can display some kind of progress for all installs.</p>
<pre>void onNewInstall(
  in {{AMInterface("AddonInstall")}} install
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>install</dt> <dd>The {{ AMInterface("AddonInstall") }} representing the install</dd>
</dl>
<h3 id="onDownloadStarted()">onDownloadStarted()</h3>
<p>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.</p>
<pre>void onDownloadStarted(
  in {{AMInterface("AddonInstall")}} install
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>install</dt> <dd>The {{ AMInterface("AddonInstall") }} representing the install</dd>
</dl>
<h3 id="onDownloadProgress()">onDownloadProgress()</h3>
<p>Called as data is received during a download. Check the {{ AMInterface("AddonInstall","progress") }} property for the amount of data downloaded and the {{ AMInterface("AddonInstall","maxProgress") }} property for the total data expected. A listener may return false to cancel the download.</p>
<pre>void onDownloadProgress(
  in {{AMInterface("AddonInstall")}} install
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>install</dt> <dd>The {{ AMInterface("AddonInstall") }} representing the install</dd>
</dl>
<h3 id="onDownloadEnded()">onDownloadEnded()</h3>
<p>Called when downloading completes successfully for an add-on install. Only called for add-ons that need to be downloaded.</p>
<pre>void onDownloadEnded(
  in {{AMInterface("AddonInstall")}} install
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>install</dt> <dd>The {{ AMInterface("AddonInstall") }} representing the install</dd>
</dl>
<h3 id="onDownloadCancelled()">onDownloadCancelled()</h3>
<p>Called when downloading is cancelled. Only called for add-ons that need to be downloaded.</p>
<pre>void onDownloadCancelled(
  in {{AMInterface("AddonInstall")}} install
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>install</dt> <dd>The {{ AMInterface("AddonInstall") }} representing the install</dd>
</dl>
<h3 id="onDownloadFailed()">onDownloadFailed()</h3>
<p>Called if there is some error downloading the add-on. Only called for add-ons that need to be downloaded.</p>
<pre>void onDownloadFailed(
  in {{AMInterface("AddonInstall")}} install
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>install</dt> <dd>The {{ AMInterface("AddonInstall") }} representing the install</dd>
</dl>
<h3 id="onInstallStarted()">onInstallStarted()</h3>
<p>Called when installation of an add-on begins. A listener may return false to cancel the install.</p>
<pre>void onInstallStarted(
  in {{AMInterface("AddonInstall")}} install
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>install</dt> <dd>The {{ AMInterface("AddonInstall") }} representing the install</dd>
</dl>
<h3 id="onInstallEnded()">onInstallEnded()</h3>
<p>Called when installation of an add-on is complete. The newly installed add-on may require a restart in order to become active.</p>
<pre>void onInstallEnded(
  in {{AMInterface("AddonInstall")}} install
  in {{AMInterface("Addon")}} addon
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>install</dt> <dd>The {{ AMInterface("AddonInstall") }} representing the install</dd> <dt>addon</dt> <dd>The {{ AMInterface("Addon") }} addon that has been installed</dd>
</dl>
<h3 id="onInstallCancelled()">onInstallCancelled()</h3>
<p>Called when installation is cancelled.</p>
<pre>void onInstallCancelled(
  in {{AMInterface("AddonInstall")}} install
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>install</dt> <dd>The {{ AMInterface("AddonInstall") }} representing the install</dd>
</dl>
<h3 id="onInstallFailed()">onInstallFailed()</h3>
<p>Called when there is a failure installing the add-on.</p>
<pre>void onInstallFailed(
  in {{AMInterface("AddonInstall")}} install
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>install</dt> <dd>The {{ AMInterface("AddonInstall") }} representing the install</dd>
</dl>
<h3 id="onExternalInstall()">onExternalInstall()</h3>
<p>Called when an add-on is installed through some system other than an {{ AMInterface("AddonInstall") }}.</p>
<pre>void onExternalInstall(
  in {{AMInterface("Addon")}} addon,
  in {{AMInterface("Addon")}} existingAddon,
  in boolean needsRestart
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>addon</dt> <dd>The newly installed {{ AMInterface("Addon") }}</dd> <dt>existingAddon</dt> <dd>An {{ AMInterface("Addon") }} that will be replaced by this install or null if no add-on is being replaced</dd> <dt>needsRestart</dt> <dd>True if the installation requires a restart</dd>
</dl>
Revert to this revision