1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-07 23:34:11 +01:00

Death to E4X and stuff.

This commit is contained in:
Kris Maglione
2012-11-30 20:46:38 -08:00
parent dff13c70fc
commit da3785028d
6 changed files with 138 additions and 30 deletions

View File

@@ -483,10 +483,10 @@ var Contexts = Module("contexts", {
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);
let info = "INFO" in context && Cu.evalInSandbox("this.INFO instanceof XML ? INFO.toXMLString() : this.INFO", context);
return /^</.test(info) ? XML(info) : info;
}
if (typeof context.INFO == "xml")
if (typeof context.INFO == "xml" || DOM.isJSONXML(context.INFO))
return context.INFO;
}
catch (e) {}