Created
February 5, 2014 18:43
-
-
Save dewdad/8830348 to your computer and use it in GitHub Desktop.
Overriding xmlhttprequest open to tamper with requests in JavaScript apps
From http://stackoverflow.com/questions/7775767/javascript-overriding-xmlhttprequest-open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var proxied = window.XMLHttpRequest.prototype.open; | |
window.XMLHttpRequest.prototype.open = function() { | |
console.log( arguments ); | |
return proxied.apply(this, [].slice.call(arguments)); | |
}; | |
})(); | |
/* | |
["POST", "/ajax/chat/buddy_list.php?__a=1", true] | |
["POST", "/ajax/apps/usage_update.php?__a=1", true] | |
["POST", "/ajax/chat/buddy_list.php?__a=1", true] | |
["POST", "/ajax/canvas_ticker.php?__a=1", true] | |
["POST", "/ajax/canvas_ticker.php?__a=1", true] | |
["POST", "/ajax/chat/buddy_list.php?__a=1", true] | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment