Dajbych.net


Browsers Will Freeze its User-Agent Strings

, 2 minutes to read

http2 logo

The User-Agent HTTP header was introduced in 1993 by the first web browser. The string was as simple as Mosaic/0.9. It could be used for good purposes. Web servers can serve slightly different content to browsers that might implement new standards differently. Sadly, Google is abusing its dominant position by blocking or malfunctioning its services for competitive browsers. Therefore, a new mechanism for declaring the technical aspects of a user’s device is emerging.

There are thousands of UA string parsing and decision algorithms worldwide, and new browsers should ideally be compatible with all of them. Of course, this is not even possible. Browser sniffing is very difficult and always has been. The long-term plan is to freeze the UA string and consolidate it into something that will not reveal much information about the user’s device.

Instead, there is a new standard on the horizon that reveals important characteristics of the user’s device.

Client Hints

Client Hints are a set of HTTP request headers that the browser can send to the server. The web page must opt-in for these headers by sending this header in the response:

Accept-CH: Viewport-Width, Downlink

or by declaring a specialized meta tag:

<meta http-equiv="Accept-CH" content="Viewport-Width, Downlink">

The browser will include the following headers in the upcoming requests:

Viewport-Width: 1080
Downlink: 2.5

This standard will possibly replace picture and srcset responsive images because it can handle more complex use cases.

Current List of Device Hints