Skip to content

Commit

Permalink
Specify __exposedProps__ for xmlhttprequester.
Browse files Browse the repository at this point in the history
  • Loading branch information
arantius committed Aug 30, 2012
1 parent 0bc425a commit 001560b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion content/xmlhttprequester.js
Expand Up @@ -41,7 +41,17 @@ GM_xmlhttpRequester.prototype.contentStartRequest = function(details) {
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;
Expand Down Expand Up @@ -137,6 +147,14 @@ function(wrappedContentWin, req, event, details) {

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,
Expand Down

0 comments on commit 001560b

Please sign in to comment.