Skip to content

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

Merged
Elchi3 merged 9 commits intomdn:mainfrom
KurtCattiSchmidt:modulepreload-link-json
Feb 24, 2026
Merged

Add HTML link element attribute values as="{json,script,style}" for modulepreload#29048
Elchi3 merged 9 commits intomdn:mainfrom
KurtCattiSchmidt:modulepreload-link-json

Conversation

@KurtCattiSchmidt
Copy link
Contributor

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
Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

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

Let's add bugs for Firefox and Safari.

KurtCattiSchmidt and others added 4 commits February 20, 2026 09:33
Co-authored-by: Claas Augner <495429+caugner@users.noreply.github.com>
Co-authored-by: Claas Augner <495429+caugner@users.noreply.github.com>
Co-authored-by: Claas Augner <495429+caugner@users.noreply.github.com>
Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

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

Thank you! 👍

@Elchi3 Elchi3 dismissed caugner’s stale review February 24, 2026 10:54

Bug links were added

@Elchi3 Elchi3 merged commit cdb1a07 into mdn:main Feb 24, 2026
8 checks passed
@mdn-bot mdn-bot mentioned this pull request Feb 24, 2026
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.

3 participants