Bug 620528 - Always follow lab kit instructions on install
authorEdward Lee <edilee@mozilla.com>
Mon, 20 Dec 2010 15:02:49 -0800
changeset 23 ab383cd2d6d9551a15c5ec8c5a048c7a68103704
parent 22 250db0a9d078d652134b7d16774a81b6d7ee9144
child 24 b32ec8ed88b8aa4fb6abc4e7ae7952b4becad6c5
push id24
push useredward.lee@engineering.uiuc.edu
push dateMon, 20 Dec 2010 23:03:13 +0000
bugs620528
Bug 620528 - Always follow lab kit instructions on install Reset the whole pref branch when installing to process the json manifest.
bootstrap.js
--- a/bootstrap.js
+++ b/bootstrap.js
@@ -450,8 +450,22 @@ function startup(data, reason) AddonMana
  * Handle the add-on being deactivated on uninstall/disable
  */
 function shutdown(data, reason) {
   if (reason == ADDON_DISABLE)
     disableInstalled();
 
   unloaders.forEach(function(unload) unload());
 }
+
+/**
+ * Handle the add-on being installed
+ */
+function install(data, reason) {
+  // Clear out any old preferences/state when installed
+  Cu.import("resource://services-sync/ext/Preferences.js");
+  prefs.resetBranch("");
+}
+
+/**
+ * Handle the add-on being uninstalled
+ */
+function uninstall(data, reason) {}