Skip to content
Merged
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
10 changes: 3 additions & 7 deletions src/browser/ScriptManager.zig
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,10 @@ pub fn addFromElement(self: *ScriptManager, element: *parser.Element) !void {
if (std.ascii.eqlIgnoreCase(script_type, "module")) {
break :blk .module;
}
if (std.ascii.eqlIgnoreCase(script_type, "application/json")) {
return;
}
if (std.ascii.eqlIgnoreCase(script_type, "application/ld+json")) {
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand why you remove these kind?
The won't create more log warning then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh you remove the warning too 🤦 my bad.
What about using debug instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought about it. On the fence.

On the one hand I thought: good to log in case there's a type we don't handle that we should (which is the intention behind the original code). On the other hand, some sites have a lot of text/template, and I felt the noise outweighed the maybe-one-day-it-will-be-useful


log.warn(.user_script, "unknown script type", .{ .type = script_type });
// "type" could be anything, but only the above are ones we need to process.
// Common other ones are application/json, application/ld+json, text/template

return;
};

Expand Down