1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-13 14:45:45 +01:00

Minor refactoring of last commit.

This commit is contained in:
Kris Maglione
2011-06-06 17:50:31 -04:00
parent 5c89527d3f
commit 6d162f167d
2 changed files with 17 additions and 8 deletions

View File

@@ -216,11 +216,12 @@ var Contexts = Module("contexts", {
contexts.removeGroup(this.GROUP);
})
});
if (group !== this.user)
Class.replaceProperty(plugins, file.path, self);
// This belongs elsewhere
if (isPlugin && args)
if (isPlugin)
Object.defineProperty(plugins, self.NAME, {
configurable: true,
enumerable: true,
@@ -357,6 +358,19 @@ var Contexts = Module("contexts", {
return group;
},
getDocs: function getDocs(context) {
try {
if (isinstance(context, ["Sandbox"])) {
let info = "INFO" in context && Cu.evalInSandbox("this.INFO instanceof XML && INFO.toXMLString()", context);
return info && XML(info);
}
if (typeof context.INFO == "xml")
return context.INFO;
}
catch (e) {}
return null;
},
bindMacro: function (args, default_, params) {
const { dactyl, events, modules } = this.modules;