Skip to content

Add HTML link element attribute values as="{json,script,style}" for modulepreload#29048

Open
KurtCattiSchmidt wants to merge 3 commits intomdn:mainfrom
KurtCattiSchmidt:modulepreload-link-json
Open

Add HTML link element attribute values as="{json,script,style}" for modulepreload#29048
KurtCattiSchmidt wants to merge 3 commits intomdn:mainfrom
KurtCattiSchmidt:modulepreload-link-json

Conversation

@KurtCattiSchmidt
Copy link

Summary

This change adds as="style", as="script", and as="json" to the <link rel="modulepreload"> compat data. Chromium is shipping this in 147, so this adds that data as well (see https://chromestatus.com/feature/5202661416763392).

Test results and supporting details

as="script" is the default, and support for this goes back to when each browser originally supported <link rel="modulepreload">. Chrome 147 will begin supporting as="style" and as="json", and Safari recently added support for as="json", in version 26.2 (see "Fixed “text/json/json+json” to be considered an invalid JSON MIME type." note in https://developer.apple.com/documentation/safari-release-notes/safari-26_2-release-notes).

WPT tests reflecting these results:

For Chrome 147 supporting JSON and style modulepreloads, see Experimental results: https://wpt.fyi/results/preload/modulepreload-as.html?label=master&label=experimental&aligned&q=modulepreload-as.html

For Safari 26 supporting JSON modulepreloads, see https://wpt.fyi/results/preload/modulepreload-as.html?label=stable&label=master&aligned

https://chromestatus.com/feature/5202661416763392
https://developer.apple.com/documentation/safari-release-notes/safari-26_2-release-notes

Related issues

@github-actions github-actions bot added data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML size:m [PR only] 25-100 LoC changed labels Feb 13, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

@caugner caugner changed the title Add as="style", as="script", and as="json" to modulepreload Add HTML link element attribute values as="{json,script,style}" for modulepreload Feb 18, 2026
},
"status": {
"experimental": true,
"standard_track": true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Setting standard_track: true requires providing a spec_url.

In this case, we can to link to https://html.spec.whatwg.org/multipage/links.html#preload-destination for all values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML size:m [PR only] 25-100 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants