wanghongenpin / network_proxy_flutter

Open source free capture HTTP(S) traffic software ProxyPin, supporting full platform systems
Apache License 2.0
6.73k stars 577 forks source link

Android 抓不到js调试工具的请求包 #300

Open M17764017422 opened 1 month ago

M17764017422 commented 1 month ago

描述错误(Describe the bug) 抓不到软件自带的JavaScript调试工具的fetch请求包 To Reproduce 重现行为的步骤:导航菜单->工具箱->JavaScript,运行:

fetch('https://jsonplaceholder.typicode.com/posts')
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

调试界面有返回结果但请求列表里抓不到刚才的包 *屏幕截图(Screenshots) https://github.com/user-attachments/assets/9bfd330b-e2d4-4916-a34d-652d4bb57560

wanghongenpin commented 1 month ago

脚本里的请求不支持抓包

M17764017422 commented 1 month ago

为什么?接口测试这还是有需求的,http工具又不支持解析粘贴的cURL命令格式,js工具不支持抓包fetch请求也不行。 Screenshot_2024-08-31-01-00-37-461-edit_com.kiwibrowser.browser.jpg

ghcsd commented 1 month ago

确实,之前写的脚本一旦开启就会随机中断加载小程序。 一直找不到脚本的问题所在,调试了好久才发现是cookie验证通不过, 脚本中的请求可能一直在302跳转,阻塞了脚本执行,导致响应超时, 由于fetch redirect 默认是 follow 这种情况没异常抛出,真的非常难察觉。 如果能看到脚本中的请求包就能很快确定问题。