1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-28 16:52:27 +01:00

Fix about:pentadactyl by registering the component manually. Et cetera.

This commit is contained in:
Kris Maglione
2011-01-03 17:06:28 -05:00
parent e8c5664c8f
commit 30ec5fc393
9 changed files with 98 additions and 46 deletions

31
common/bootstrap.js vendored
View File

@@ -88,28 +88,16 @@ FactoryProxy.prototype = {
QueryInterface: XPCOMUtils.generateQI(Ci.nsIFactory),
register: function () {
dump("dactyl: bootstrap: register: " + this.classID + " " + this.contractID + "\n");
manager.registerFactory(this.classID,
String(this.classID),
this.contractID,
this);
},
unregister: function () {
dump("dactyl: bootstrap: unregister: " + this.classID + " " + this.contractID + "\n");
manager.unregisterFactory(this.classID, this);
JSMLoader.registerFactory(this);
},
get module() {
try {
dump("dactyl: bootstrap: create module: " + this.contractID + "\n");
Object.defineProperty(this, "module", { value: {}, enumerable: true });
JSMLoader.load(this.url, this.module);
JSMLoader.registerGlobal(this.url, this.module.global);
return this.module;
}
catch (e) {
delete this.module;
reportError(e);
throw e;
}
dump("dactyl: bootstrap: create module: " + this.contractID + "\n");
Object.defineProperty(this, "module", { value: {}, enumerable: true });
JSMLoader.load(this.url, this.module);
JSMLoader.registerGlobal(this.url, this.module.global);
return this.module;
},
createInstance: function (iids) {
return let (factory = this.module.NSGetFactory(this.classID))
@@ -194,9 +182,6 @@ function shutdown(data, reason) {
services.observer.notifyObservers(null, "dactyl-cleanup", null);
services.observer.notifyObservers(null, "dactyl-cleanup-modules", null);
for (let factory in values(components))
// TODO: Categories;
factory.unregister();
}
}