瀏覽器監聽所有xhr請求
如果需要在瀏覽器裡截獲所有的ajax請求,可以如下操作
var origOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function() {
this.addEventListener('load', function() {
// console.log(this.readyState); //will always be 4 (ajax is completed successfully)
// console.log(this.responseText); //whatever the response was
console.log(1)
})
origOpen.apply(this, arguments)
}
「其他文章」
- mongodb資料分片
- ES如何關閉提前快取nested資料
- nodejs如何編譯成二進位制檔案執行
- k8s新增預設本地磁碟
- docker pull改成國內映象
- 阿里雲映象安裝kubeadm和kubernetes
- selinux的開啟和關閉
- git如何刪除所有tag(本地和遠端)
- 【pkg】把node.js打包成多平臺二進位制可執行檔案
- 瀏覽器監聽所有xhr請求
- elasticsearch如何搜尋巢狀內容
- 【express-basic-auth】瀏覽器內建登陸
- 【lru-cache】node.js的自動淘汰快取
- docker之ffmpeg多階段構建
- mysql如何統計資料庫大小
- node.js獲取客戶端的真實ip地址
- killall命令如何安裝
- digital ocean如何掛載spaces
- 【he】node.js如何方便地HTML轉義
- mac如何開啟身份不明開發者的程式