browser: remove useless switch

This commit is contained in:
Pierre Tachoire
2024-01-05 11:45:57 +01:00
parent b96a251c37
commit b778749511

View File

@@ -225,8 +225,10 @@ pub const Page = struct {
const e = parser.nodeToElement(next.?);
const tag = try parser.elementHTMLGetTagType(@as(*parser.ElementHTML, @ptrCast(e)));
switch (tag) {
.script => {
// ignore non-script tags
if (tag != .script) continue;
// ignore non-js script.
// > type
// > Attribute is not set (default), an empty string, or a JavaScript MIME
@@ -274,9 +276,6 @@ pub const Page = struct {
// > page.
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#notes
self.evalScript(e) catch |err| log.warn("evaljs: {any}", .{err});
},
else => continue,
}
}
// TODO wait for deferred scripts