Skip to content

Commit

Permalink
Merge pull request #13271 from kuschti/patch-1
Browse files Browse the repository at this point in the history
Core: Fix template script tag support
  • Loading branch information
shilman committed Nov 27, 2020
2 parents 813b4dd + 7fe4330 commit 31f287f
Showing 1 changed file with 5 additions and 3 deletions.
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

0 comments on commit 31f287f

Please sign in to comment.