mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-14 19:35:45 +01:00
[bootstrap] Purge stale modules on upgrade as well as explicit rehash.
--HG-- branch : bootstrapped
This commit is contained in:
@@ -249,10 +249,10 @@ var Overlay = Module("Overlay", {
|
||||
util.dump("Loaded in " + (Date.now() - start) + "ms");
|
||||
|
||||
modules.events.addSessionListener(window, "unload", function onUnload() {
|
||||
window.removeEventListener("unload", onUnload, false);
|
||||
window.removeEventListener("unload", onUnload.wrapped, false);
|
||||
for (let [, mod] in iter(modules))
|
||||
if (mod instanceof ModuleBase && "destroy" in mod)
|
||||
mod.destroy();
|
||||
util.trapErrors(mod.destroy, mod);
|
||||
}, false);
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -949,6 +949,9 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
module.init();
|
||||
}
|
||||
},
|
||||
"dactyl-purge": function () {
|
||||
this.rehashing = true;
|
||||
},
|
||||
"toplevel-window-ready": function (window, data) {
|
||||
window.addEventListener("DOMContentLoaded", wrapCallback(function listener(event) {
|
||||
if (event.originalTarget === window.document) {
|
||||
@@ -1163,9 +1166,9 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
}),
|
||||
|
||||
rehash: function () {
|
||||
this.rehashing = true;
|
||||
this.addon.userDisabled = true;
|
||||
this.timeout(function () {
|
||||
this.rehashing = true;
|
||||
this.addon.userDisabled = true;
|
||||
this.addon.userDisabled = false;
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user