在一些場景調試或我們給一些網站進行“注入”js代碼,我們想動態獲取網站的全部請求鏈接與內容,以下一小段代碼可以實現這個目標
Object.defineProperty(XMLHttpRequest.prototype,"status",{
get: function(status) {
console.log({
url: this.responseURL,
data: this.response
})
}
})
