Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 添加jsIgnores和cssIgnores两个插件 #95

Merged
merged 1 commit into from
Aug 25, 2022

Conversation

yiludege
Copy link
Collaborator

  • 提交符合commit规范
  • 文档更改
  • 测试用例添加
  • npm run test通过
详细描述

@yiludege yiludege merged commit 7631e7c into master Aug 25, 2022
@yiludege yiludege deleted the feat/add-ignore-plugins branch August 28, 2022 02:28
@skytt
Copy link

skytt commented Sep 7, 2022

版本是 rc13;试了一下,jsonp 的请求,添加到 jsIgnores 以后,只有第一次 fetch 不会被主框架捕获,后续的请求依然会走主框的fetch来进行,导致跨域

@yiludege
Copy link
Collaborator Author

yiludege commented Sep 7, 2022

我在 demo 中没有发现此类问题,多次点击发起 jsonp 请求都会通过 iframe 自身外链的 script 来发起请求的
企业微信截图_47b964b0-fc01-4e4a-b440-a87a9eaad3a6

@skytt
Copy link

skytt commented Sep 7, 2022

我在 demo 中没有发现此类问题,多次点击发起 jsonp 请求都会通过 iframe 自身外链的 script 来发起请求的 企业微信截图_47b964b0-fc01-4e4a-b440-a87a9eaad3a6

抱歉,确实是我使用的问题,占用您时间了~ 我配置的 jsIgnores 是正则条件,刚刚断点进去查发现 plugins 作为 effectLoaders 实例化后是重复使用的,我正则里手贱加多了个 g 标志,导致整个正则实例被二次匹配的时候起始位置不是 0 下标了... URL 里只有一处可满足条件的匹配位置,所以返回 false 了。

从坑里爬出来了~ 看看有需要,可以考虑在文档中加入对使用正则条件的 tips,如类似 主框生命周期内正则实例会被重复用来匹配 之类的话术,再次感谢~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants