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

fix: 兼容主应用拦截原生的createElement #275

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

Xusenbiao
Copy link
Contributor

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

当主应用需要拦截原生的createElement时,自然会将createElementthis指向主应用的document
然而,目前在wujieproxyDocument中,是统一使用主应用的createElement,并尝试将this指向iframedocument

在使用过程中发现,如果wujieproxyDocument中,执行了被主应用改写过的createElement导致this最终指向主应用的document,会导致子应用内的节点,element instanceof HTMLElement 得到false

因此,在wujieproxyDocument中改为使用同域iframecreateElement方法。

@yiludege
Copy link
Collaborator

很棒的工作,我刚想这么做 pr 就做好了 😄

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