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: 修复qiankun本身在沙箱下运行时,可能出现无法劫持document.createElement元素问题 #1046

Merged
merged 2 commits into from
Nov 5, 2020

Conversation

bloody-ux
Copy link
Contributor

Checklist
  • npm test passes
  • tests are included
  • documentation is changed or added
  • commit message follows commit guidelines
Description of change
  • 优化了沙箱劫持document.createElement的逻辑: 当qiankun运行在另一个沙箱下的时候,可能document已经被重写为新的实例,这个时候在documentAttachProxyMap内存储的是被重写document实例,而在patchDocumentCreateElement获取的时候,this指向的是原生的document,会导致无法获取attachProxy

kuitos
kuitos previously approved these changes Nov 5, 2020
src/sandbox/patchers/dynamicAppend/forStrictSandbox.ts Outdated Show resolved Hide resolved
@kuitos kuitos merged commit 5520a7b into umijs:master Nov 5, 2020
kuitos pushed a commit that referenced this pull request May 29, 2022
…run in another sandbox while may rewrite document(#1046)
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.

None yet

2 participants