[Pkg-mozext-commits] [greasemonkey] 05/20: Add the `mozAnon` parameter to GM_xhr.
David Prévot
taffit at moszumanska.debian.org
Fri Mar 25 21:37:19 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository greasemonkey.
commit 535d996c3266b99158fa0cd2729027551d8b4ebf
Author: Anthony Lieuallen <arantius at gmail.com>
Date: Fri Feb 19 15:07:47 2016 -0500
Add the `mozAnon` parameter to GM_xhr.
Fixes #2330
---
modules/xmlhttprequester.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/modules/xmlhttprequester.js b/modules/xmlhttprequester.js
index b3e9eeb..28554cf 100644
--- a/modules/xmlhttprequester.js
+++ b/modules/xmlhttprequester.js
@@ -9,6 +9,8 @@ var gStringBundle = Components
.getService(Components.interfaces.nsIStringBundleService)
.createBundle("chrome://greasemonkey/locale/greasemonkey.properties");
+Components.utils.importGlobalProperties(['XMLHttpRequest']);
+
function GM_xmlhttpRequester(wrappedContentWin, originUrl, sandbox) {
this.wrappedContentWin = wrappedContentWin;
@@ -48,8 +50,8 @@ GM_xmlhttpRequester.prototype.contentStartRequest = function(details) {
case "http":
case "https":
case "ftp":
- var req = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
- .createInstance(Components.interfaces.nsIXMLHttpRequest);
+ var req = new XMLHttpRequest(
+ details.mozAnon ? {'mozAnon': true} : {});
GM_util.hitch(this, "chromeStartRequest", url, details, req)();
break;
default:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git
More information about the Pkg-mozext-commits
mailing list