Labs/Jetpack/Reboot/JEP/105: Difference between revisions

Jump to navigation Jump to search
Line 23: Line 23:
me = require("me");
me = require("me");


// eventName is one of install
// eventName is one of install, upgrade
me.bind(eventName, callback);
me.bind(eventName, callback);


Line 29: Line 29:
// These are potential convenience functions
// These are potential convenience functions
me.onInstall( function )
me.onInstall( function )
me.onUpgrade( function )
</pre>
</pre>


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).
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). <code>me.onUpgrade</code> get's called when an extension is upgraded.
 
Nothing is passed to the <code>onInstall</code> handler. An object which contains version info for the add-on prior to being updated gets passed to <code>onUpgrade</code>.


There does not seem to be a strong use-case for allowing for event handlers that act upon disabling, enabling, and un-installing an extension.
There does not seem to be a strong use-case for allowing for event handlers that act upon disabling, enabling, and un-installing an extension.
577

edits

Navigation menu