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

🐛 add the missing parameter for execScript #438

Merged
merged 1 commit into from
Apr 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/sandbox/patchers/dynamicHeadAppend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default function patch(

const { fetch } = frameworkConfiguration;
if (src) {
execScripts(null, [src], realProxy, { fetch }).then(
execScripts(null, [src], realProxy, { fetch, strictGlobal: !singular }).then(
() => {
// we need to invoke the onload event manually to notify the event listener that the script was completed
// here are the two typical ways of dynamic script loading
Expand All @@ -139,7 +139,10 @@ export default function patch(
return rawAppendChild.call(realAppWrapperGetter(), dynamicScriptCommentElement) as T;
}

execScripts(null, [`<script>${text}</script>`], realProxy).then(element.onload, element.onerror);
execScripts(null, [`<script>${text}</script>`], realProxy, { strictGlobal: !singular }).then(
element.onload,
element.onerror,
);
const dynamicInlineScriptCommentElement = document.createComment('dynamic inline script replaced by qiankun');
return rawAppendChild.call(realAppWrapperGetter(), dynamicInlineScriptCommentElement) as T;
}
Expand Down