Merge pull request #514 from lightpanda-io/js-kind
Some checks failed
e2e-test / zig build release (push) Has been cancelled
e2e-test / puppeteer-perf (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
wpt / web platform tests (push) Has been cancelled
wpt / web platform tests json output (push) Has been cancelled
wpt / perf-fmt (push) Has been cancelled
zig-test / zig build dev (push) Has been cancelled
zig-test / browser fetch (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
nightly build / build-linux-x86_64 (push) Has been cancelled
nightly build / build-linux-aarch64 (push) Has been cancelled
nightly build / build-macos-aarch64 (push) Has been cancelled
nightly build / build-macos-x86_64 (push) Has been cancelled

browser: script with type text/javascript are js
This commit is contained in:
Pierre Tachoire
2025-04-07 22:22:35 +02:00
committed by GitHub

View File

@@ -723,6 +723,7 @@ pub const Page = struct {
fn parseKind(stype: ?[]const u8) Kind { fn parseKind(stype: ?[]const u8) Kind {
if (stype == null or stype.?.len == 0) return .javascript; if (stype == null or stype.?.len == 0) return .javascript;
if (std.mem.eql(u8, stype.?, "application/javascript")) return .javascript; if (std.mem.eql(u8, stype.?, "application/javascript")) return .javascript;
if (std.mem.eql(u8, stype.?, "text/javascript")) return .javascript;
if (std.mem.eql(u8, stype.?, "module")) return .module; if (std.mem.eql(u8, stype.?, "module")) return .module;
return .unknown; return .unknown;