577
edits
No edit summary |
|||
Line 23: | Line 23: | ||
me = require("me"); | me = require("me"); | ||
me. | // eventName is one of install, uninstall | ||
me.bind(eventName, callback); | |||
// These are potential convenience functions | |||
me.onInstall( function ) | me.onInstall( function ) | ||
me.onUninstall( function ) | me.onUninstall( function ) | ||
</pre> | </pre> | ||
The <code>me. | The <code>me.onInstall</code> gets called on the first run of an extension. If an extension is uninstalled and reinstalled it gets called again (as the act of uninstalling removes all data associated with the add-on). | ||
There does not seem to be a strong use-case for allowing for event handlers that act upon disabling and enabling an extension. | |||
==== Declarative ==== | ==== Declarative ==== | ||
Line 40: | Line 42: | ||
<pre class="brush:js;"> | <pre class="brush:js;"> | ||
manifest = { | manifest = { | ||
installPage: stringOrXml, | |||
uninstallPage: stringOrXml | uninstallPage: stringOrXml | ||
} | } | ||
Line 61: | Line 63: | ||
* What methods, mechanisms, or resources does this provide internally within the Jetpack platform code. | * What methods, mechanisms, or resources does this provide internally within the Jetpack platform code. | ||
=== Use Cases === | |||
* Show a welcome page/tutorial when you install an add-on. | |||
* Show a set of tooltips for the UI that an extension has added, in vivo to the interface. | |||
* Give a survey when you uninstall an add-on. | |||
edits