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

Core: Fix template script tag support #13271

Merged
merged 1 commit into from Nov 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/client-api/src/simulate-pageload.ts
Expand Up @@ -82,15 +82,17 @@ export function simulatePageLoad($container: any) {
const typeAttr = $script.getAttribute('type');

// only run script tags without the type attribute
// or with a javascript mime attribute value
if (!typeAttr || !runScriptTypes.includes(typeAttr)) {
// or with a javascript mime attribute value from the list
if (!typeAttr || runScriptTypes.includes(typeAttr)) {
scriptsToExecute.push((callback: any) => insertScript($script, callback, $scriptsRoot));
}
});

// insert the script tags sequentially
// to preserve execution order
insertScriptsSequentially(scriptsToExecute, simulateDOMContentLoaded, undefined);
if (scriptsToExecute.length) {
insertScriptsSequentially(scriptsToExecute, simulateDOMContentLoaded, undefined);
}
} else {
simulateDOMContentLoaded();
}
Expand Down