mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-07 23:24:12 +01:00
Death to E4X and stuff.
This commit is contained in:
@@ -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) {}
|
||||
|
||||
@@ -50,8 +50,12 @@ function NetError(orig, error) {
|
||||
}).data.QueryInterface(Ci.nsIChannel);
|
||||
}
|
||||
function RedirectChannel(to, orig, time, message) {
|
||||
let html = <html><head><meta http-equiv="Refresh" content={(time || 0) + ";" + to}/></head>
|
||||
<body><h2 style="text-align: center">{message || ""}</h2></body></html>.toXMLString();
|
||||
let html = DOM.toXML(
|
||||
["html", {},
|
||||
["head", {},
|
||||
["meta", { "http-equiv": "Refresh", content: (time || 0) + ";" + to }]],
|
||||
["body", {},
|
||||
["h2", { style: "text-align: center" }, message || ""]]]);
|
||||
return StringChannel(html, "text/html", services.io.newURI(to, null, null));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user