Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add crossorigin attribute to Link header for scripts with type=module #16

Conversation

andyexeter
Copy link
Collaborator

Resolves #15

This PR stores the tag object for each rendered script in the rendered scripts array so the type attribute can be checked in the PreloadAssetsEventListener.

If the type is module, we add the crossorigin attribute to the Link header.

Copy link

netlify bot commented Jan 30, 2024

Deploy Preview for cosmic-bubblegum-aa631a canceled.

Name Link
🔨 Latest commit 59d724b
🔍 Latest deploy log https://app.netlify.com/sites/cosmic-bubblegum-aa631a/deploys/65c620c4357a3e00089899cd

@andyexeter andyexeter force-pushed the 15-crossorigin-attribute-on-module-link-headers branch from 4ea2024 to 2a4cfa1 Compare February 9, 2024 12:33
@andyexeter
Copy link
Collaborator Author

I've updated the PR to use the value of the crossorigin bundle config option.

Btw @lhapaipai, I noticed the CI workflow for the bundle is only running on PHP 8.2:

I think we should update this to run on all supported versions.

@lhapaipai lhapaipai merged commit 59d724b into lhapaipai:main Feb 9, 2024
6 checks passed
@lhapaipai
Copy link
Owner

thank you very much @andyexeter for your valuable suggestions !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crossorigin attribute needs adding to Link headers
2 participants