diff --git a/common/content/dactyl.js b/common/content/dactyl.js index d1b3c203..68b49855 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -413,7 +413,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { ({ file: fileName, line: lineNumber, context: ctxt }) = info; if (!context && fileName && fileName[0] !== "[") - context = _userContext || ctxt; + context = ctxt || _userContext; if (isinstance(context, ["Sandbox"])) return Cu.evalInSandbox(str, context, "1.8", fileName, lineNumber); @@ -668,20 +668,30 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { let body = XML(); for (let [, context] in Iterator(plugins.contexts)) - if (context && context.INFO instanceof XML) { - let info = context.INFO; - if (info.*.@lang.length()) { - let lang = config.bestLocale(String(a) for each (a in info.*.@lang)); + try { + let info; + if (isinstance(context, ["Sandbox"])) + info = "INFO" in context && XML(dactyl.userEval("this.INFO instanceof XML && this.INFO.toXMLString()", context)); + else if (context && context.INFO instanceof XML) + info = context.INFO; - info.* = info.*.(function::attribute("lang").length() == 0 || @lang == lang); + if (info) { + if (info.*.@lang.length()) { + let lang = config.bestLocale(String(a) for each (a in info.*.@lang)); - for each (let elem in info.NS::info) - for each (let attr in ["@name", "@summary", "@href"]) - if (elem[attr].length()) - info[attr] = elem[attr]; + info.* = info.*.(function::attribute("lang").length() == 0 || @lang == lang); + + for each (let elem in info.NS::info) + for each (let attr in ["@name", "@summary", "@href"]) + if (elem[attr].length()) + info[attr] = elem[attr]; + } + body +=

{info.@summary}

+ + info; } - body +=

{context.INFO.@summary}

+ - context.INFO; + } + catch (e) { + util.reportError(e); } let help = diff --git a/common/modules/storage.jsm b/common/modules/storage.jsm index 85f46455..75b0cb6e 100644 --- a/common/modules/storage.jsm +++ b/common/modules/storage.jsm @@ -316,6 +316,11 @@ var File = Class("File", { return self; }, + /** + * @property {nsIFileURL} Returns the nsIFileURL object for this file. + */ + get URI() services.io.newFileURI(this), + /** * Iterates over the objects in this directory. */