Skip to content

preload_tag filter lacking crossorigin option #1738

@chris-naturesgold

Description

@chris-naturesgold

I have the following code, which theme-check is flagging as "For better performance, prefer using the preload_tag filter":

<link rel="preload" as="font" href="{{ header_font | font_url }}" type="font/woff2" crossorigin>

I tried using this liquid:

{{ header_font | font_url | preload_tag: as: 'font' }}

which generates this code:

<link href="not a real url" rel="preload" as="font" rel="preload">

But as its missing the crossorigin tag, this code isn't used due to CORS

Is adding the option to specifiy a crossorigin tag the correct approach?

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