(function(send) {
XMLHttpRequest.prototype.send = function (request) {
this.addEventListener('load', function (request) {
if (this.responseURL.indexOf(location.origin) == 0) {
console.log(request);
};
});
send.apply(this, arguments);
}
})(XMLHttpRequest.prototype.send)
var original = {
open: XMLHttpRequest.prototype.open,
send: XMLHttpRequest.prototype.send
};
XMLHttpRequest.prototype.open = function (method, url, async, user, password) {
console.log('Параметры запроса:', [method, url, async, user, password]);
return original.open.call(this, method, url, async, user, password);
};
XMLHttpRequest.prototype.send = function (data) {
console.log('Тело запроса:', data);
return original.send.call(this, data);
};