mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-15 21:45:47 +01:00
[bootstrap] Add a :rehash (temporarily undocumented) command.
--HG-- branch : bootstrapped
This commit is contained in:
@@ -36,6 +36,7 @@ var Services = Module("Services", {
|
||||
this.add("extensionManager", "@mozilla.org/extensions/manager;1", Ci.nsIExtensionManager);
|
||||
this.add("favicon", "@mozilla.org/browser/favicon-service;1", Ci.nsIFaviconService);
|
||||
this.add("focus", "@mozilla.org/focus-manager;1", Ci.nsIFocusManager);
|
||||
this.add("fuel", "@mozilla.org/fuel/application;1", Ci.fuelIApplication);
|
||||
this.add("history", "@mozilla.org/browser/global-history;2", [Ci.nsIBrowserHistory, Ci.nsIGlobalHistory3,
|
||||
Ci.nsINavHistoryService, Ci.nsPIPlacesDatabase]);
|
||||
this.add("io", "@mozilla.org/network/io-service;1", Ci.nsIIOService);
|
||||
|
||||
@@ -59,6 +59,8 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
}
|
||||
},
|
||||
|
||||
get addon() services.fuel.storage.get("dactyl.bootstrap", null).addon,
|
||||
|
||||
// FIXME: Only works for Pentadactyl
|
||||
get activeWindow() services.windowMediator.getMostRecentWindow("navigator:browser"),
|
||||
dactyl: update(function dactyl(obj) {
|
||||
@@ -920,7 +922,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
services.observer.removeObserver(this, "dactyl-rehash");
|
||||
|
||||
util.dump("dactyl: util: observe: dactyl-rehash");
|
||||
if (true)
|
||||
if (this.rehashing)
|
||||
JSMLoader.purge();
|
||||
else
|
||||
for (let module in values(defineModule.modules)) {
|
||||
@@ -1144,6 +1146,14 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
getSource: function regexp_getSource(re) re.source.replace(/\\(.)/g, function (m0, m1) m1 === "/" ? "/" : m0)
|
||||
}),
|
||||
|
||||
rehash: function () {
|
||||
this.rehashing = true;
|
||||
this.addon.userDisabled = true;
|
||||
this.timeout(function () {
|
||||
this.addon.userDisabled = false;
|
||||
});
|
||||
},
|
||||
|
||||
maxErrors: 15,
|
||||
errors: Class.memoize(function () []),
|
||||
reportError: function (error) {
|
||||
|
||||
Reference in New Issue
Block a user