浏览器监听所有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如何打开身份不明开发者的程序