Skip to content
Open
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
6 changes: 3 additions & 3 deletions packages/astro/src/transitions/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function runScripts() {
// inline module scripts cannot be awaited for with onload.
// Thus to be able to wait for the execution of all scripts, we make sure that the last inline module script
// is always followed by an external module script
for (const script of document.getElementsByTagName('script')) {
for (const script of Array.from(document.getElementsByTagName('script'))) {
script.dataset.astroExec === undefined &&
script.getAttribute('type') === 'module' &&
(needsWaitForInlineModuleScript = script.getAttribute('src') === null);
Expand All @@ -142,7 +142,7 @@ function runScripts() {
`<script type="module" src="data:application/javascript,"/>`,
);

for (const script of document.getElementsByTagName('script')) {
for (const script of Array.from(document.getElementsByTagName('script'))) {
if (script.dataset.astroExec === '') continue;
const type = script.getAttribute('type');
if (type && type !== 'module' && type !== 'text/javascript') continue;
Expand Down Expand Up @@ -681,7 +681,7 @@ if (inBrowser) {
);
}
}
for (const script of document.getElementsByTagName('script')) {
for (const script of Array.from(document.getElementsByTagName('script'))) {
detectScriptExecuted(script);
script.dataset.astroExec = '';
}
Expand Down
Loading