Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Do not pass a chrome window to GM_xmlhttpRequester.

  • Loading branch information...
commit 668b18d34236c8e6c07b885300a95ffeb148c0d4 1 parent dc6458e
@arantius arantius authored
Showing with 5 additions and 6 deletions.
  1. +1 −2  components/greasemonkey.js
  2. +4 −4 content/xmlhttprequester.js
View
3  components/greasemonkey.js
@@ -109,8 +109,7 @@ function createSandbox(
sandbox.GM_listValues = GM_util.hitch(scriptStorage, 'listValues');
sandbox.GM_openInTab = GM_util.hitch(null, openInTab, aContentWin, aChromeWin);
sandbox.GM_xmlhttpRequest = GM_util.hitch(
- new GM_xmlhttpRequester(aContentWin, aChromeWin, aUrl),
- 'contentStartRequest');
+ new GM_xmlhttpRequester(aContentWin, aUrl), 'contentStartRequest');
return sandbox;
}
View
8 content/xmlhttprequester.js
@@ -1,8 +1,7 @@
Components.utils.import("resource://greasemonkey/util.js");
-function GM_xmlhttpRequester(wrappedContentWin, chromeWindow, originUrl) {
+function GM_xmlhttpRequester(wrappedContentWin, originUrl) {
this.wrappedContentWin = wrappedContentWin;
- this.chromeWindow = chromeWindow;
this.originUrl = originUrl;
}
@@ -34,8 +33,9 @@ GM_xmlhttpRequester.prototype.contentStartRequest = function(details) {
case "http":
case "https":
case "ftp":
- var req = new this.chromeWindow.XMLHttpRequest();
- GM_util.hitch(this, "chromeStartRequest", url, details, req)();
+ var req = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
+ .createInstance();
+ this.chromeStartRequest(url, details, req);
break;
default:
throw new Error("Disallowed scheme in URL: " + details.url);
Please sign in to comment.
Something went wrong with that request. Please try again.