Closed xinyu-shopastro closed 1 year ago
子应用中往父容器 head 节点动态 appendChild 新节点时,新节点实际挂载在子应用里面
head
appendChild
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 中
求告知这种需求应该怎么实现
子应用要操作主应用的 dom 就属于沙箱逃逸了,这个不符合预期。 如果一定要这么做只能把沙箱关了。
What happens?
子应用中往父容器
head
节点动态appendChild
新节点时,新节点实际挂载在子应用里面How To Reproduce
Steps to reproduce the behavior: 1. 2.
Expected behavior 1. 2. 子应用中往父容器
head
节点appendChild
新节点时,新节点应该添加到父级head
中Context
求告知这种需求应该怎么实现