Skip to content

Commit 7862fc7

Browse files
authored
Merge pull request #640 from lightpanda-io/script_nomodule
Don't load script tags with the nomodule attribute
2 parents b2605dd + dc0e278 commit 7862fc7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/browser/browser.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,12 @@ pub const Page = struct {
759759
return null;
760760
}
761761

762+
if (try parser.elementGetAttribute(e, "nomodule") != null) {
763+
// these scripts should only be loaded if we don't support modules
764+
// but since we do support modules, we can just skip them.
765+
return null;
766+
}
767+
762768
const kind = parseKind(try parser.elementGetAttribute(e, "type")) orelse {
763769
return null;
764770
};

0 commit comments

Comments
 (0)