WICG / responsive-image-client-hints

A spec for a suite of client hints, useful for content negotiation for responsive images
https://wicg.github.io/responsive-image-client-hints
Other
7 stars 9 forks source link

Client hint capturing viewing distance #29

Open eeeps opened 1 year ago

eeeps commented 1 year ago

Devices increasingly have sensors telling them how far away the user is from the screen. This is encoded in a very general, one-size-fits way by how the user-agent decides to define 1px, hopefully somewhat matching the reference pixel most of the time for most users. But not always, of course, and when that viewing distance is greater than expected, there are opportunities to send lower-resolution, faster-to-load image resources.

Maybe Sec-CH-1px-Visual-Angle with a value in arcminutes or degrees or whatever.

Maybe Sec-CH-Reference-Pixel-Ratio = the actual visual angle occupied by 1px at the user's current viewing distance / 0.0213 degrees (would slightly simplify some math).

We would need this exposed in a JS API first, of course.

It seems fairly variable over time (reducing fingerprinting risk), although until most devices could send it, the presence of a value or a value other than the default could be used to fingerprint.