ajax-hook icon indicating copy to clipboard operation
ajax-hook copied to clipboard

Intercepting browser's http requests which made by XMLHttpRequest.

Results 47 ajax-hook issues
Sort by recently updated
recently updated
newest added

``` hookAjax({ onabort: function(){ console.log('abort'); } }) $.ajax({ url: '任意接口', timeout: 1000 }) ``` 慢网下触发onabort 同时报错: ![image](https://user-images.githubusercontent.com/5107016/68204988-26db5900-0004-11ea-9786-9305c0db1d73.png)

JQuery ajaxTransport 使用异步会把 onload 和 change 吃掉 那么 onload 或者 onreadystatechange没法抓了,只能抓到 open 和 send

如题,如果网络断开了,这个时候原生可以监听到error事件,那么这里该如何处理?

我有个需求是获取重定向地址,并不是想做页面跳转。

想在readyState为1(open方法已经被调用,但还没调用send方法)时调用setRequestHeader方法设置header,但在onreadystatechange里打印readyState,从未出现过为1的状态,想请教下是什么原因,谢谢。 代码如下: ![image](https://user-images.githubusercontent.com/26788533/53181620-dfa66700-3632-11e9-8eec-2958ca204211.png) 以下是在控制台打印的结果: ![image](https://user-images.githubusercontent.com/26788533/53181722-12e8f600-3633-11e9-81df-d1efefee1d16.png)

请问怎么拦截同步的请求呢,因为同步请求不会触发onreadystatechange。

版本: 3.0.3 报错位置:src/xhr-hook 111:21 偶现但某一个页面中复现概率较大,赞未排查出必现链路 场景:页面中可能有多个ajax-hook以及xhook