Commit 3d987c3
🐛 处理GM xhr的问题 (#1082)
* 处理GM xhr的问题
* 补上单元测试
* 恢复之前的单元测试
* 增加 readyState 判断 修复 responseText 问题
* 删除调试日志
* `${Date.now}` -> `${Date.now()}`
* 修复fetch模式下,触发 readyState==1的问题
* fetch行为与TM保持一致
* 调整测试
* 修改错误的单元测试
* GMXhr 代码修正
* 中文
* 中文
* parseType 代码改善
* 调整代码
* 加入 allowResponse 特殊处理:readyState 达至 4 之前,排除 response, responseText, responseXML
* `res.readyState === 4` -> `res.readyState === 4 || reqDone`
* Update gm_xhr.ts
* 调整代码
* typescript 调整
* 增加逻辑控制保护
* typescript 调整
* 处理共用
* 整理代码
* 修复错误
---------
Co-authored-by: cyfung1031 <44498510+cyfung1031@users.noreply.github.com>1 parent b43880e commit 3d987c3
File tree
10 files changed
+265
-210
lines changed- example/tests
- src
- app/service/content/gm_api
- pkg/utils/xhr
- template
- types
- tests/mocks
10 files changed
+265
-210
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1221 | 1221 | | |
1222 | 1222 | | |
1223 | 1223 | | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
1224 | 1262 | | |
1225 | 1263 | | |
1226 | 1264 | | |
| |||
0 commit comments