Dajbych.net


Browsers will freeze its User-Agent strings

, 3 minutes to read

The User-Agent HTTP header was in­tro­duced in 1993 by the first web browser. The string was as sim­ple as Mo­saic/0.9. It could be used for good pur­poses. Web server can serve slightly dif­fer­ent con­tent to browsers which might im­ple­ment new stan­dards dif­fer­ently. Sadly, Google is abus­ing its dom­i­nant po­si­tion to block­ing or mal­func­tion­ing its ser­vices for com­pet­i­tive browsers. There­fore, a new mech­a­nism of declar­ing tech­ni­cal as­pects of user’s de­vice is emerg­ing.

There are thou­sands of UA string pars­ing a de­cide al­gorithms world­wide and new browser should be ide­ally com­pat­i­ble with all of them. Of course, this is not even pos­si­ble. Browser sniff­ing is very dif­fi­cult and al­ways was. The long-term plan is to freeze the UA string and con­sol­i­date it into some­thing what will not re­veal much in­for­ma­tion about user’s de­vice.

In­stead, there is a new stan­dard on the hori­zon which re­veals im­por­tant char­ac­ter­is­tics of the user’s de­vice.

Client Hints

Client Hints are a set of HTTP re­quest headers which browser could send to the server. Web page must opt-in for these headers by send­ing this header in the re­sponse:

Accept-CH: Viewport-Width, Downlink

or by declar­ing a spe­cial­ized meta tag:

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

The browser will in­clude fol­low­ing headers in the up­com­ing re­quests:

Viewport-Width: 1080 Downlink: 2.5

This stan­dard will pos­sibly re­place pic­ture and src­set re­spon­sive im­ages be­cause it can han­dle more com­plex use cases.

Current list of device hints