Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Don't emit type=text/javascript on script tags #1207

@GuillaumeRossolini

Description

@GuillaumeRossolini

Hi,
I noticed mod_pagespeed includes a new "script" tag inside "head". Which is normal, but in this case the head already had a "script" tag:

<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:g="http://base.google.com/ns/1.0" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://ogp.me/ns/fb#" xml:lang=en lang=en>
<head>
<script type='text/javascript'>window.mod_pagespeed_start = Number(new Date());</script><script>var FileAPI={

Maybe there could be a way to merge these tags? Although their declaration is not strictly identical, I have heard that for certain doctypes, the "type" attribute of the "script" tag is unnecessary. Maybe stripping this attribute could be another "less bytes" optimization for pagespeed, and in this case merging two tags as well?
Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions