WICG / ua-client-hints

Wouldn't it be nice if `User-Agent` was a (set of) client hints?
https://wicg.github.io/ua-client-hints/
Other
591 stars 77 forks source link

How does a client disable sending high entropy hints to the browser? #356

Closed prarsena closed 9 months ago

prarsena commented 9 months ago

I've been exploring css media queries, UA-CH, and other aspects related to the exchange of data between the OS and a website in a blog post.

In the MDN docs for User-Agent Client Hints API, it makes mention of the differences between low-entropy and high-entropy values. Is there a way for a user to disable sending their high entropy values with their request? I saw some mention that UA-CH are safer for users than a traditional UA string, but I didn't find instructions for the user to withhold sending certain data to the server.

Also related to the web API, is there a way to return the Sec-CH-Prefers-Color-Scheme value or other User Preference Media Features through navigator.userAgentData? Or plans to allow this?

Sora2455 commented 9 months ago

In the MDN docs for User-Agent Client Hints API, it makes mention of the differences between low-entropy and high-entropy values. Is there a way for a user to disable sending their high entropy values with their request?

That would be a question for the individual browser makers, not a spec question. IIRC, the spec only recommends that such controls are available.

Also related to the web API, is there a way to return the Sec-CH-Prefers-Color-Scheme value or other User Preference Media Features through navigator.userAgentData? Or plans to allow this?

Out of scope of this proposal, but you want matchMedia("(prefers-color-scheme: light)").matches or matchMedia("(prefers-color-scheme: dark)").matches.

miketaylr commented 9 months ago

Yes, @Sora2455 is correct - this would be more in the realm of a feature request for the browser (via pref, extension, UI etc) to disable the API.