New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GM_xmlhttpRequest response.responseText is undefined in Nightly17.0a1 since landing of Bug553102 #1607
Comments
possible fix --- a/content/xmlhttprequester.js 2012-08-09 12:45:42 +0900 +++ b/content/xmlhttprequester.js 2012-08-23 12:05:31 +0900 @@ -36,17 +36,27 @@ case "ftp": var req = new this.chromeWindow.XMLHttpRequest(); GM_util.hitch(this, "chromeStartRequest", url, details, req)(); break; default: throw new Error("Disallowed scheme in URL: " + details.url); } - var rv = { abort: function () { return req.abort(); } }; + var rv = { + __exposedProps__: { + finalUrl: "r", + readyState: "r", + responseHeaders: "r", + responseText: "r", + status: "r", + statusText: "r" + }, + abort: function () { return req.abort(); } + }; if (!!details.synchronous) { rv.finalUrl = req.finalUrl; rv.readyState = req.readyState; rv.responseHeaders = req.getAllResponseHeaders(); rv.responseText = req.responseText; rv.status = req.status; rv.statusText = req.statusText; } @@ -132,16 +142,24 @@ // method by the same name which is a property of 'details' in the content // window's security context. GM_xmlhttpRequester.prototype.setupRequestEvent = function(wrappedContentWin, req, event, details) { if (!details["on" + event]) return; req.addEventListener(event, function(evt) { var responseState = { + __exposedProps__: { + finalUrl: "r", + readyState: "r", + responseHeaders: "r", + responseText: "r", + status: "r", + statusText: "r" + }, // Can't support responseXML because security won't // let the browser call properties on it. responseText: req.responseText, readyState: req.readyState, responseHeaders: null, status: null, statusText: null, finalUrl: null |
Hi arantius, Thanks, |
https://github.com/arantius/greasemonkey-compiler Pull requests accepted. |
Thanks. Actually, now when I compared the code, I see that you have fixed it on the web version but not here on github repository linked above. So the only reason mine was broken was that I had compiled it long back. But that smalll exposedprops change in the xmlhttprequester.js fixed it in my extension! Thanks again. |
- Compatibility fix with Greasemonkey 1.1 and Firefox 15+. See also [greasemonkey#1595](http://github.com/greasemonkey/greasemonkey/issues/1595) and [greasemonkey#1607](greasemonkey/greasemonkey#1607). Reenables inline versions and diffs. - Misc tweak 69307.503483 1930d046f0f8c6e9daded2e337128e83acdbf69b
In Greasemonkey 1.0b7 and Nightly17.0a1 .
response.responseText is undefined .
This problem happens since landing of Bug553102
GM_xmlhttpRequest({
method: "GET",
url: "http://www.google.com/",
onload: function(response) {
alert(response.responseText);
}
});
The text was updated successfully, but these errors were encountered: