(function(open) { XMLHttpRequest.prototype.open = function(method, url, async, user, password) { this.addEventListener("load", function() { console.log('XMLHttpRequest 请求完成', method, url); }); open.call(this, method, url, async, user, password); }; })(XMLHttpRequest.prototype.open); (function(fetch) { window.fetch = function() { return fetch.apply(this, arguments).then(function(response) { console.log('fetch 请求完成', response.url); return response; }); }; })(window.fetch);