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

子应用中往父容器 head 节点动态 appendChild 新节点时,新节点挂载在子应用 #2511

Closed
xinyu-shopastro opened this issue May 24, 2023 · 2 comments

Comments

@xinyu-shopastro
Copy link

xinyu-shopastro commented May 24, 2023

What happens?

子应用中往父容器 head 节点动态 appendChild 新节点时,新节点实际挂载在子应用里面

How To Reproduce

Steps to reproduce the behavior: 1. 2.

  const head = document.querySelector('head');
  const linkTag = document.createElement('link');
  linkTag.setAttribute('rel', 'shortcut icon');
  linkTag.setAttribute('type', 'image/svg');
  linkTag.setAttribute('id', 'new-favicon');
  linkTag.setAttribute('href', iconUrl);
  head.appendChild(linkTag);

Expected behavior 1. 2. 子应用中往父容器 head 节点 appendChild 新节点时,新节点应该添加到父级 head

Context

  • qiankun Version: 2.10.8
  • Platform Version:
  • Browser Version:

求告知这种需求应该怎么实现

@xinyu-shopastro
Copy link
Author

#2502

@kuitos
Copy link
Member

kuitos commented May 25, 2023

子应用要操作主应用的 dom 就属于沙箱逃逸了,这个不符合预期。
如果一定要这么做只能把沙箱关了。

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

No branches or pull requests

2 participants