1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-03 22:54:12 +01:00

Flush the startup cache when re-sourcing a JS file.

This commit is contained in:
Kris Maglione
2011-08-06 10:09:21 -04:00
parent d828a53b7a
commit f1493e5e8a
3 changed files with 20 additions and 5 deletions

View File

@@ -1652,6 +1652,13 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
}())
}),
/**
* Flushes the startup cache.
*/
flushCache: function flushCache() {
services.observer.notifyObservers(null, "startupcache-invalidate", "");
},
/**
* Reloads dactyl in entirety by disabling the add-on and
* re-enabling it.
@@ -1659,7 +1666,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
rehash: function (args) {
storage.session.commandlineArgs = args;
this.timeout(function () {
services.observer.notifyObservers(null, "startupcache-invalidate", "");
this.flushCache();
this.rehashing = true;
let addon = config.addon;
addon.userDisabled = true;