Skip to content

crossorigin: undefined behaves non-uniformly on preload tag #293

@Ingramz

Description

@Ingramz

🐛 The bug

When using crossorigin attribute on script to opt-out of default security feature of crossorigin="anonymous", it is possible to use either crossorigin: false or crossorigin: undefined to do this. However, when using undefined, only the script tag will be stripped of the attribute and not the corresponding preload tag.

When reading the source code for registry scripts, I learned that the "right" way to opt-out currently seems to be using false or null.

return useScript({
  src: 'https://s.kk-resources.com/leadtag.js',
  async: true,
  crossorigin: false,
})

Considering how common it can be that the developers want to opt out from crossorigin="anonymous" default, both values should either work uniformly or the developer should be better informed of the differences between the possible falsy values.

🛠️ To reproduce

See description

🌈 Expected behavior

🌈

ℹ️ Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions