browser-compat-data icon indicating copy to clipboard operation
browser-compat-data copied to clipboard

Add more `Sec-CH` Client Hint headers

Open tunetheweb opened this issue 1 week ago • 1 comments

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: https://github.com/mdn/content/pull/42351

tunetheweb avatar Dec 11 '25 11:12 tunetheweb

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

github-actions[bot] avatar Dec 11 '25 11:12 github-actions[bot]

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 avatar Dec 12 '25 16:12 tunetheweb

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.

tunetheweb avatar Dec 12 '25 17:12 tunetheweb