User-Agent Reduction deprecation trial

Register to continue receiving the full User-Agent string.

Published on

Starting from Chrome 101, the information available in the User-Agent (UA) string will be reduced using a phased approach. Sites that haven't had time to migrate away from using the reduced User-Agent string and move toward User-Agent Client Hints can take part in a deprecation trial to continue receiving the full User-Agent string.

The registration for the deprecation trial will begin with the Chrome 100 Beta. It will allow sites to receive the full User-Agent string ahead of the Chrome 101 release, where the minor version string will be reduced. If you would like to test the origin trial on Chrome 100 Beta before it launches to the stable channel, be sure to register and test before the release date for Chrome 100 (currently scheduled for March 31st, 2022).

Below is an overview of the deprecation trial and what to expect. If you have feedback to share or you encounter any issues throughout this trial let us know in the UA Reduction Github repository.

What does this mean for web developers?

By enrolling in the deprecation trial, sites will continue to receive the full UA string in navigator.userAgent and non-reduced values in the related navigator.platform and navigator.appVersion JavaScript getters:

  • The User-Agent HTTP request header
  • The navigator.userAgent Javascript getter
  • The navigator.platform Javascript getter
  • The navigator.appVersion Javascript getter

Sites should still audit their usage of the User-Agent header and related APIs, and if needed prepare to migrate to User-Agent Client Hints before the deprecation trial expires. The intent is to expire this deprecation trial once the User-Agent Reduction rollout is complete.

How do I participate in the User-Agent Reduction deprecation trial?

Register for the trial

To register for the origin trial and get a token for your domains, visit the User Agent Reduction deprecation trial page.

Setup

Once you've registerd for the trial, update your HTTP response headers with the following:

  1. Add Origin-Trial: <ORIGIN TRIAL TOKEN> to your HTTP response header. <ORIGIN TRIAL TOKEN> contains the token you got when registering for the origin trial.
  2. Add Accept-CH: Sec-CH-UA-Full to your HTTP response header. Setting Accept-CH will only cause the full User-Agent string to be sent on subsequent requests to the origin.
  3. To resend the first navigation request with the full User-Agent string, add Critical-CH: Sec-CH-UA-Full to your HTTP response header, in addition to the Accept-CH and Origin-Trial headers.
  4. If you want third-party subresource requests to also receive the full UA string, you have two options:
    • Add a Permissions-Policy header with the third-party domains that should receive the full UA.
      • To allow a named list of third-party domains, add Permissions-Policy: ch-ua-full=(self "https://google.com").
      • To allow all third-party domains, add Permissions-Policy: ch-ua-full=*.
    • Add an Accept-CH meta tag with the third-party domains that should receive the full UA (only in Chrome 100 and above).
      • To allow a named list of third-party domains, add <meta name="accept-ch" content="ch-ua-full=( https://google.com )">.
      • It's not possible to delegate to all third-party domains via * in the meta tag.
  5. Load your website in Chrome 100 (or later) and continue receiving the full User-Agent string.

Demo

See https://uard-ot-demo.glitch.me for a demonstration of the trial (along with the source code).

How do I validate that the trial is working?

To validate that the origin trial is working, examine the request headers and ensure the following:

  1. The User-Agent header contains the full version. It shouldn't contain any of the reduced values (found in the list of samples of reduced User-Agent strings). An easy way to tell is that the Chrome minor version string should not be 0.0.0.
  2. The Sec-CH-UA-Full header is set to ?1.

The initial response's headers containing the origin-trial token should look like:

Subsequent request headers containing the full User-Agent string should look like:

How do I stop participating in the User-Agent Reduction deprecation trial?

At any given point in time during the trial, you can stop participating and receive the reduced User-Agent string. To stop participating:

  1. Send an Accept-CH header in your HTTP response that does not include Sec-CH-UA-Full. Note that Accept-CH with an empty value is a valid way to accomplish this if your site does not request any other Client Hints.
  2. Remove the Origin-Trial header for the User-Agent Reduction deprecation trial from your HTTP response.
  3. If set, remove Sec-CH-UA-Full from the Critical-CH header in your HTTP response.

How is this trial different from other User-Agent origin trials?

Chrome is running two origin trials related to User Agent reduction. The first was User Agent Reduction origin trial, which allowed sites to receive the reduced user agent string to test their use cases and provide feedback before it becomes the default behavior in Chrome.

The second, referenced here, is a deprecation trial intended for sites that need a little more time to migrate to the User-Agent Client Hints API. It enables sites to continue receiving the full User-Agent string.

How long will the deprecation trial last?

The UA Reduction deprecation trial will run from Chrome 100 to Chrome 112. Chrome 113 will be the first release where only the completely reduced User-Agent string is sent.

How do I share feedback for the User-Agent Reduction depreciation trial?

Submit any issues or feedback to the User-Agent Reduction Github repository.

Last updated: Improve article

We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.