Skip to content

Add more Sec-CH Client Hint headers#28636

Merged
caugner merged 10 commits intomdn:mainfrom
tunetheweb:sec-ch-viewport-width-height
Dec 12, 2025
Merged

Add more Sec-CH Client Hint headers#28636
caugner merged 10 commits intomdn:mainfrom
tunetheweb:sec-ch-viewport-width-height

Conversation

@tunetheweb
Copy link
Copy Markdown
Contributor

@tunetheweb tunetheweb commented Dec 11, 2025

Summary

Adds the following Client Heights as supported by Chrome:

  • Sec-CH-Device-Memory
  • Sec-CH-DPR
  • Sec-CH-Viewport-Height
  • Sec-CH-Viewport-Width

Test results and supporting details

Visiting https://browserleaks.com/client-hints with Chrome shows the following:

image

Note that Sec-CH-Device-Memory is currently still specced as Device-Memory but I've opened a PR to change that

Device-Memory, DPR and Width were added in Chrome 97: https://chromestatus.com/feature/6658223894429696 (note Device-Memory was not noted there)

Height was added in Chrome 105: https://chromestatus.com/feature/5646861215989760

Related issues

MDN Content PR: mdn/content#42351

@github-actions github-actions Bot added data:http Compat data for HTTP features. https://developer.mozilla.org/docs/Web/HTTP size:l [PR only] 101-1000 LoC changed labels Dec 11, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 11, 2025

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

Copy link
Copy Markdown
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.

LGTM overall, just some nits about documenting alternative names.

Assuming I need Accept-CH: Viewport-Width to get Viewport-Width, and Accept-CH: Sec-CH-Viewport-Width to get Sec-CH-Viewport-Width, maybe these aren't strictly equivalent, but it might be useful for readers to find these mentioned in the BCD table of the corresponding SEC-CH-* headers.

Are there plans to remove those unprefixed headers, or does this depend on usage counts?

Comment thread http/headers/Device-Memory.json
Comment thread http/headers/Sec-CH-Viewport-Width.json Outdated
Comment thread http/headers/Sec-CH-DPR.json Outdated
@tunetheweb
Copy link
Copy Markdown
Contributor Author

LGTM overall, just some nits about documenting alternative names.

Assuming I need Accept-CH: Viewport-Width to get Viewport-Width, and Accept-CH: Sec-CH-Viewport-Width to get Sec-CH-Viewport-Width, maybe these aren't strictly equivalent

That is correct. You can in theory also ask for them both and get both! Though not sure why you'd want to do that...

but it might be useful for readers to find these mentioned in the BCD table of the corresponding SEC-CH-* headers.

I think alternative_name is a good solution here. I'd still keep the old names as separate entries too since just using alternative_name would suggest the old names stopped working once the new names came along and that's not true.

Are there plans to remove those unprefixed headers, or does this depend on usage counts?

Yeah, ideally we'd drop them, but usage count is too high for that. Part of my reasoning for documenting this in MDN (and marking old names as deprecated) is an effort to push that along. Can't blame people for not switching when we only doucment the old ones! Anyway, TLDR I think they will continue to both be supported for some time.

@tunetheweb
Copy link
Copy Markdown
Contributor Author

Should be good for another look @caugner

FYI Sec-CH-Viewport-Height didn't have an old name as it was introduced after the migration.

@caugner caugner merged commit 2b5510c into mdn:main Dec 12, 2025
8 checks passed
@mdn-bot mdn-bot mentioned this pull request Dec 12, 2025
@tunetheweb tunetheweb mentioned this pull request Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:http Compat data for HTTP features. https://developer.mozilla.org/docs/Web/HTTP size:l [PR only] 101-1000 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants