Skip to content

Commit

Permalink
fix #57
Browse files Browse the repository at this point in the history
  • Loading branch information
wendux committed Jun 13, 2022
1 parent 5b0de57 commit 505806a
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ajax-hook是用于拦截浏览器 XMLHttpRequest 对象的轻量库,它可以

## 更新记录

2.1.2版本已发布,2.x和1.x最大的区别是添加了`proxy`方法且同时支持TypeScript,详请见[change list](./change-list.md)
2.1.3已发布,2.x和1.x最大的区别是添加了`proxy`方法且同时支持TypeScript,详请见[change list](./change-list.md)

## 使用

Expand All @@ -18,7 +18,7 @@ ajax-hook是用于拦截浏览器 XMLHttpRequest 对象的轻量库,它可以
- CDN引入

```html
<script src="https://unpkg.com/[email protected].2/dist/ajaxhook.min.js"></script>
<script src="https://unpkg.com/[email protected].3/dist/ajaxhook.min.js"></script>
```

引入后会有一个名为"ah"(ajax hook)的全局对象,通过它可以调用ajax-hook的API,如`ah.proxy(hooks)`
Expand Down
2 changes: 1 addition & 1 deletion dist/ajaxhook.core.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ajaxhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ function Proxy(proxy, win) {
setRequestHeader: function setRequestHeader(args, xhr) {
// Collect request headers
xhr.config.headers[args[0].toLowerCase()] = args[1];
return true;
if (onRequest) return true;
},
addEventListener: function addEventListener(args, xhr) {
var _this = this;
Expand Down
2 changes: 1 addition & 1 deletion dist/ajaxhook.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/ajaxhook.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ajaxhook.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ function Proxy(proxy, win) {
setRequestHeader: function setRequestHeader(args, xhr) {
// Collect request headers
xhr.config.headers[args[0].toLowerCase()] = args[1];
return true;
if (onRequest) return true;
},
addEventListener: function addEventListener(args, xhr) {
var _this = this;
Expand Down
Loading

0 comments on commit 505806a

Please sign in to comment.