WICG / client-hints-infrastructure

Specification for the Client Hints infrastructure - privacy preserving proactive content negotiation
https://wicg.github.io/client-hints-infrastructure
Other
61 stars 26 forks source link

Usability of ACCEPT_CH frame #125

Open bvattikonda opened 2 years ago

bvattikonda commented 2 years ago

Summary

Teams across Google have been experimenting with User-Agent Client Hints for the last several months. Overall, User-Agent Client Hints offer a promising replacement for information being removed from the User-Agent header as part of User-Agent Reduction efforts. In particular the use of structured headers allows for reliable parsing of client hints.

We have, however, faced challenges collecting client hints using the ACCEPT_CH frame. We encountered bugs which have forced us to roll back the collection of client hints via ACCEPT_CH frame. If User-Agent Reduction goes into effect before the usability issues with the ACCEPT_CH frame are resolved, the lack of client hints on certain requests would break user experiences.

We recommend that Chrome create a new code point inside the ALPS protocol so that frontends can roll out support for it. Chrome can then rollout the new code point through the standard process and discover any potential bugs without affecting users of stable versions of Chrome. Implementing a new code point would effectively implement versioning in ALPS and frontends can choose the code points to support.

Details

We are able to parse client hints using the structured headers library which makes consuming user agent information easier than parsing the traditional User-Agent header. We also note that the browser capabilities detailed by the client hints will allow Google services to enhance user experiences.

One of the challenges that we have not been able to overcome is getting client hint information for the first request from the browser. We have been trying to request User-Agent Client Hints using the ACCEPT_CH frame, but ran into the following bugs:

For crbug/1292069, the LTS merge requested will fix the issue for Chrome 96 and above but users of older (or not updated) versions of Chrome may be left without access to Google services. This can occur when an origin sends a frame that is larger than 127 bytes or (in the less common scenario) if the origin itself is longer than 127 bytes. We recommend that websites relying on the ACCEPT_CH frame and looking to support users of older versions of Chrome should refrain from sending a frame larger than 127 bytes. This means that the ACCEPT_CH frame cannot be used to request all possible User-Agent client hints but may be used for a subset of the client hints.

miketaylr commented 2 years ago

Thanks for the feedback @bvattikonda! I think it makes sense for this to live in https://github.com/WICG/client-hints-infrastructure, but let's leave it here for a week or two in case others aren't following that repo.