Skip to content

Commit

Permalink
🐛 document.head.removeChild should be hooked in sandbox (#2522)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuitos authored Jun 7, 2023
1 parent cf0ee02 commit 521efb8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sandbox/patchers/dynamicAppend/forStrictSandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ function patchDocument(cfg: { sandbox: SandBox; speedy: boolean }) {
const qiankunHead = getAppWrapperHeadElement(containerConfig.appWrapperGetter());
qiankunHead.appendChild = HTMLHeadElement.prototype.appendChild;
qiankunHead.insertBefore = HTMLHeadElement.prototype.insertBefore;
qiankunHead.removeChild = HTMLHeadElement.prototype.removeChild;
return qiankunHead;
}
break;
Expand Down Expand Up @@ -247,13 +248,13 @@ export function patchStrictSandbox(
// all dynamic style sheets are stored in proxy container
const { dynamicStyleSheetElements } = containerConfig;

const unpatchDocument = patchDocument({ sandbox, speedy: speedySandbox });

const unpatchDynamicAppendPrototypeFunctions = patchHTMLDynamicAppendPrototypeFunctions(
(element) => elementAttachContainerConfigMap.has(element),
(element) => elementAttachContainerConfigMap.get(element)!,
);

const unpatchDocument = patchDocument({ sandbox, speedy: speedySandbox });

if (!mounting) calcAppCount(appName, 'increase', 'bootstrapping');
if (mounting) calcAppCount(appName, 'increase', 'mounting');

Expand Down

1 comment on commit 521efb8

@vercel
Copy link

@vercel vercel bot commented on 521efb8 Jun 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.