AddonListener

  • Revision slug: Addons/Add-on_Manager/AddonListener
  • Revision title: AddonListener
  • Revision id: 72823
  • Created:
  • Creator: darktrojan
  • Is current revision? No
  • Comment make templates work in argument lists; 18 words added, 9 words removed

Revision Content

{{ gecko_minversion_header("2.0") }}

AddonListeners can be registered with {{ AMInterface("AddonManager","addAddonListener") }} and will then receive notification of changes to the add-ons currently installed. These notifications come in the form of calls to methods on the listener object. A listener only needs to implement the methods corresponding to the events it cares about, missing methods will not cause any problems.

Method Overview

void onEnabling(in {{ AMInterface("Addon") }} addon, in boolean needsRestart)
void onEnabled(in {{ AMInterface("Addon") }} addon)
void onDisabling(in {{ AMInterface("Addon") }} addon, in boolean needsRestart)
void onDisabled(in {{ AMInterface("Addon") }} addon)
void onInstalling(in {{ AMInterface("Addon") }} addon, in boolean needsRestart)
void onInstalled(in {{ AMInterface("Addon") }} addon)
void onUninstalling(in {{ AMInterface("Addon") }} addon, in boolean needsRestart)
void onUninstalled(in {{ AMInterface("Addon") }} addon)
void onOperationCancelled(in {{ AMInterface("Addon") }} addon)
void onPropertyChanged(in {{ AMInterface("Addon") }} addon, in string properties[])

Methods

onEnabling()

Called when an add-on is about to be enabled.

void onEnabling(
  in {{ AMInterface("Addon") }} addon,
  in boolean needsRestart
)
Parameters
addon
The {{ AMInterface("Addon") }} that is being enabled
needsRestart
True if an application restart is necessary for the change to take effect

onEnabled()

Called when an add-on has been enabled.

void onEnabled(
  in {{ AMInterface("Addon") }} addon,
)
Parameters
addon
The {{ AMInterface("Addon") }} that has been enabled

onDisabling()

Called when an add-on is about to be disabled.

void onDisabling(
  in {{ AMInterface("Addon") }} addon,
  in boolean needsRestart
)
Parameters
addon
The {{ AMInterface("Addon") }} that is being disabled
needsRestart
True if an application restart is necessary for the change to take effect

onDisabled()

Called when an add-on has been disabled.

void onDisabled(
  in {{ AMInterface("Addon") }} addon,
)
Parameters
addon
The {{ AMInterface("Addon") }} that has been disabled

onInstalling()

Called when an add-on is about to be installed.

void onInstalling(
  in {{ AMInterface("Addon") }} addon,
  in boolean needsRestart
)
Parameters
addon
The {{ AMInterface("Addon") }} that is being installed
needsRestart
True if an application restart is necessary for the change to take effect

onInstalled()

Called when an add-on has been installed.

void onInstalled(
  in {{ AMInterface("Addon") }} addon,
)
Parameters
addon
The {{ AMInterface("Addon") }} that has been installed

onUninstalling()

Called when an add-on is about to be uninstalled.

void onUninstalling(
  in {{ AMInterface("Addon") }} addon,
  in boolean needsRestart
)
Parameters
addon
The {{ AMInterface("Addon") }} that is being uninstalled
needsRestart
True if an application restart is necessary for the change to take effect

onUninstalled()

Called when an add-on has been uninstalled.

void onUninstalled(
  in {{ AMInterface("Addon") }} addon,
)
Parameters
addon
The {{ AMInterface("Addon") }} that has been uninstalled

onOperationCancelled()

Called when a pending operation for an add-on is cancelled.

void onOperationCancelled(
  in {{ AMInterface("Addon") }} addon,
)
Parameters
addon
The {{ AMInterface("Addon") }} that has had a pending operation cancelled

onPropertyChanged()

Called when one or more properties of {{ AMInterface("Addon") }} has changed.

Only apples to the following properties:

  • applyBackgroundUpdates
void onPropertyChanged(
  in {{ AMInterface("Addon") }} addon,
  in string properties[]	
)
Parameters
addon
The {{ AMInterface("Addon") }} that has had its properties changed
properties
An array of the names of properties that changed

Revision Source

<p>{{ gecko_minversion_header("2.0") }}</p>
<p>AddonListeners can be registered with {{ AMInterface("AddonManager","addAddonListener") }} and will then receive notification of changes to the add-ons currently installed. These notifications come in the form of calls to methods on the listener object. A listener only needs to implement the methods corresponding to the events it cares about, missing methods will not cause any problems.</p>
<h2 id="Method_Overview">Method Overview</h2>
<table class="standard-table"> <tbody> <tr> <td><code>void <a href="#onEnabling()">onEnabling</a>(in {{ AMInterface("Addon") }} addon, in boolean needsRestart)</code></td> </tr> <tr> <td><code>void <a href="#onEnabled()">onEnabled</a>(in {{ AMInterface("Addon") }} addon)</code></td> </tr> <tr> <td><code>void <a href="#onDisabling()">onDisabling</a>(in {{ AMInterface("Addon") }} addon, in boolean needsRestart)</code></td> </tr> <tr> <td><code>void <a href="#onDisabled()">onDisabled</a>(in {{ AMInterface("Addon") }} addon)</code></td> </tr> <tr> <td><code>void <a href="#onInstalling()">onInstalling</a>(in {{ AMInterface("Addon") }} addon, in boolean needsRestart)</code></td> </tr> <tr> <td><code>void <a href="#onInstalled()">onInstalled</a>(in {{ AMInterface("Addon") }} addon)</code></td> </tr> <tr> <td><code>void <a href="#onUninstalling()">onUninstalling</a>(in {{ AMInterface("Addon") }} addon, in boolean needsRestart)</code></td> </tr> <tr> <td><code>void <a href="#onUninstalled()">onUninstalled</a>(in {{ AMInterface("Addon") }} addon)</code></td> </tr> <tr> <td><code>void <a href="#onOperationCancelled()">onOperationCancelled</a>(in {{ AMInterface("Addon") }} addon)</code></td> </tr> <tr> <td><code>void <a href="#onPropertyChanged()">onPropertyChanged</a>(in {{ AMInterface("Addon") }} addon, in string properties[])</code></td> </tr> </tbody>
</table>
<h2 id="Methods">Methods</h2>
<h3 id="onEnabling()">onEnabling()</h3>
<p>Called when an add-on is about to be enabled.</p>
<pre class="eval">void onEnabling(
  in {{ AMInterface("Addon") }} addon,
  in boolean needsRestart
)
</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>addon</dt> <dd>The {{ AMInterface("Addon") }} that is being enabled</dd> <dt>needsRestart</dt> <dd>True if an application restart is necessary for the change to take effect</dd>
</dl>
<h3 id="onEnabled()">onEnabled()</h3>
<p>Called when an add-on has been enabled.</p>
<pre class="eval">void onEnabled(
  in {{ AMInterface("Addon") }} addon,
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>addon</dt> <dd>The {{ AMInterface("Addon") }} that has been enabled</dd>
</dl>
<h3 id="onDisabling()">onDisabling()</h3>
<p>Called when an add-on is about to be disabled.</p>
<pre class="eval">void onDisabling(
  in {{ AMInterface("Addon") }} addon,
  in boolean needsRestart
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>addon</dt> <dd>The {{ AMInterface("Addon") }} that is being disabled</dd> <dt>needsRestart</dt> <dd>True if an application restart is necessary for the change to take effect</dd>
</dl>
<h3 id="onDisabled()">onDisabled()</h3>
<p>Called when an add-on has been disabled.</p>
<pre class="eval">void onDisabled(
  in {{ AMInterface("Addon") }} addon,
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>addon</dt> <dd>The {{ AMInterface("Addon") }} that has been disabled</dd>
</dl>
<h3 id="onInstalling()">onInstalling()</h3>
<p>Called when an add-on is about to be installed.</p>
<pre class="eval">void onInstalling(
  in {{ AMInterface("Addon") }} addon,
  in boolean needsRestart
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>addon</dt> <dd>The {{ AMInterface("Addon") }} that is being installed</dd> <dt>needsRestart</dt> <dd>True if an application restart is necessary for the change to take effect</dd>
</dl>
<h3 id="onInstalled()">onInstalled()</h3>
<p>Called when an add-on has been installed.</p>
<pre class="eval">void onInstalled(
  in {{ AMInterface("Addon") }} addon,
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>addon</dt> <dd>The {{ AMInterface("Addon") }} that has been installed</dd>
</dl>
<h3 id="onUninstalling()">onUninstalling()</h3>
<p>Called when an add-on is about to be uninstalled.</p>
<pre class="eval">void onUninstalling(
  in {{ AMInterface("Addon") }} addon,
  in boolean needsRestart
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>addon</dt> <dd>The {{ AMInterface("Addon") }} that is being uninstalled</dd> <dt>needsRestart</dt> <dd>True if an application restart is necessary for the change to take effect</dd>
</dl>
<h3 id="onUninstalled()">onUninstalled()</h3>
<p>Called when an add-on has been uninstalled.</p>
<pre class="eval">void onUninstalled(
  in {{ AMInterface("Addon") }} addon,
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>addon</dt> <dd>The {{ AMInterface("Addon") }} that has been uninstalled</dd>
</dl>
<h3 id="onOperationCancelled()">onOperationCancelled()</h3>
<p>Called when a pending operation for an add-on is cancelled.</p>
<pre class="eval">void onOperationCancelled(
  in {{ AMInterface("Addon") }} addon,
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>addon</dt> <dd>The {{ AMInterface("Addon") }} that has had a pending operation cancelled</dd>
</dl>
<h3 id="onPropertyChanged()">onPropertyChanged()</h3>
<p>Called when one or more properties of {{ AMInterface("Addon") }} has changed.</p>
<p>Only apples to the following properties:</p>
<ul> <li>applyBackgroundUpdates</li>
</ul>
<pre class="eval">void onPropertyChanged(
  in {{ AMInterface("Addon") }} addon,
  in string properties[]	
)</pre>
<h6 id="Parameters">Parameters</h6>
<dl> <dt>addon</dt> <dd>The {{ AMInterface("Addon") }} that has had its properties changed</dd> <dt>properties</dt> <dd>An array of the names of properties that changed</dd>
</dl>
Revert to this revision