Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

re-enable the sandboxed part of the GM_api

  • Loading branch information...
commit 2cff36a1db9f4db6d867b0e06ac4279cb6097c8e 1 parent 513fcce
Erik Vold authored
19 extension/modules/api/GM_sandboxScripts.js
View
@@ -1,14 +1,13 @@
"use strict";
const EXPORTED_SYMBOLS = ["GM_sandboxScripts"];
-if (!('XMLHttpRequest' in this)) {
- this.XMLHttpRequest = Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1", "nsIXMLHttpRequest");
-}
+if (!('XMLHttpRequest' in this))
+ this.XMLHttpRequest = Components.Constructor(
+ "@mozilla.org/xmlextras/xmlhttprequest;1", "nsIXMLHttpRequest");
-let r = new XMLHttpRequest();
-// don't try to parse as XML
-r.overrideMimeType('text/javascript');
-r.open('GET', 'resource://scriptish/api/sandbox.js', false);
-r.send(null);
-
-const GM_sandboxScripts = r.responseText;
+const GM_sandboxScripts = (function(r) {
+ r.overrideMimeType('text/javascript'); // don't try to parse as XML
+ r.open('GET', 'resource://scriptish/api/sandbox.js', false);
+ r.send(null);
+ return r.responseText;
+})(new XMLHttpRequest());
4 extension/modules/utils/Scriptish_injectScripts.js
View
@@ -51,10 +51,10 @@ function Scriptish_injectScripts(scripts, url, safeWin) {
// hack XPathResult since that is so commonly used
sandbox.XPathResult = XPATH_RESULT;
- // TODO: re-support below lines!
- /*
Cu.evalInSandbox(GM_sandboxScripts, sandbox);
+ // TODO: re-support below lines!
+ /*
let GM_api = new GM_API(
script, url, winID, safeWin, unsafeContentWin, chromeWin);
// add GM_* API to sandbox
Please sign in to comment.
Something went wrong with that request. Please try again.