function XMLHttpRequestBreak(fun=()=>false){
let f = XMLHttpRequest.prototype.open; let add = function(){
XMLHttpRequest.prototype.open = function(...args){
check = fun(args);
if(check){
throw check;
}
f.apply(this,args)
}
}; let remove = function(){
XMLHttpRequest.prototype.open = f
}; return {add, remove}
} test = XMLHttpRequestBreak();
test.add()
test.remove() test = XMLHttpRequestBreak(()=>"123");
test.add()
test.remove() test = XMLHttpRequestBreak(console.log);
test.add()
test.remove()

  

最新文章

  1. python3--删除所有空目录,第一个有实际用处的程序
  2. Gobblin采集kafka数据
  3. IOS第一天
  4. 新浪微博客户端(32)-设置相册图片的contentMode
  5. SpringUtil
  6. jquery自适应布局
  7. 统计字符 比如aaabbcca----3a2b1c1a
  8. c# in depth之泛型的实现
  9. HDU 4791 & ZOJ 3726 Alice's Print Service (数学 打表)
  10. 【Android Developers Training】 89. 最大化的使用谷歌云消息(Google Cloud Messaging)
  11. centos7防火墙导致不能访问的
  12. linux添加本地yum源
  13. Python内置的服务器的使用
  14. 吉哥系列故事――恨7不成妻 HDU - 4507 数位dp
  15. SNF快速开发平台--多组织+多平台+多系统处理方案
  16. 仿迅雷播放器教程 -- 基于VLC的MFC播放器 (6)
  17. MySQL Binlog和Relaylog生成和清理
  18. 13个开源GIS软件 你了解几个?
  19. wxWidgets与其他工具库的比较(上)
  20. 查看当前mysql数据库实例中,支持的字符集有哪些,或者是否支持某个特定字符集

热门文章

  1. [转载]C++STL概述
  2. Vue开发——实现吸顶效果
  3. 多个类用@feignclient标注同一个服务,出错问题:Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.Caused by: org.springframework.beans.factory.support.Bea..
  4. 忘记oracle的sys用户密码如何修改以及Oracle 11g 默认用户名和密码
  5. mysoft
  6. Shell脚本之sed详解
  7. Python、mysql四-1:单表查询
  8. PHP强制修改返回的状态码
  9. 关于order_by
  10. Java定时任务的几种方法(Thread 和 Timer,线程池)