I know how to intercept AJAX calls with XMLHttpRequest.
I looked at the docs and there is no mentioning of the parameters (POST body) .
How do I intercept those using XMLHttpRequest.
I'm trying to keep track of all the AJAX requests run on a web page.
Thanks!
This is how you do it:
XMLHttpRequest.prototype.realSend = XMLHttpRequest.prototype.send;
var newSend = function(vData) { console.log("data: " + vData); this.realSend(vData); };
XMLHttpRequest.prototype.send = newSend;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With