1. 35
  1. 21

    Ref the harmful consequences of the robustness principle, I think the user agent string and its role in compatibility is the pinnacle of failure on this metric for web standards: It enables exactly the wrong kind of compatibility and becomes a compatibility item in itself that shouldn’t be. Thus why browser sniffing is evil. As such, this kind of breakage is pure karma. May the UA string fade into unimportance.

    To be ridiculous, let’s continue the tradition of telling them what they want first and instead append the truth:

    Mozilla/5.0 (X11; Windows x86_64; KHTML) Chrome/99.0 (Wayland; Linux Aarch64; Gecko) Firefox/100.0

    1. 4

      Given Chrome’s dominance, they should flex their muscles and remove UA strings entirely. Let the world catch up to them.

      1. 8

        It’s not removal, but they are definitely intending to reduce User Agent data, replacing a bunch of platform data with hard-coded strings. For example, Chrome on Android will (eventually) always report Linux; Android 10; K regardless of kernel, Android version, or phone model.

        On the other hand, a bunch of that information is going to be exposed as Client Hints, so sites can still ask for information even if it’s not collected passively.

        1. 3

          Safari has frozen their User-Agent string: https://twitter.com/rmondello/status/943545865204989953

          My Safari reports “Intel Mac OS X 10_15_7”, and I’m on ARM macOS 12.2.

          1. 3

            My hope is that more chaos → less value → disuse → easier to remove.

            But the normative fix would be a new HTTP version.

            1. 2

              When making statements like this that support a chrome monopoly and giving google total control of the internet, I can’t help but wonder if you would have sided with MS and IE in the late 90s and early 2000s when they had the better (speed, features, site compatibility, etc) and a substantially weaker monopoly? (Remember, css was an IE driven feature, xhr was an ms created de facto standard)

              1. 4

                I don’t see anything about OP’s post that suggests they approve of chrome’s dominance, they’re just acknowledging it, and suggesting something they could do with that dominance that might improve things for the open web.

                1. 4

                  I had intended my comment to be a little tongue in cheek, but on reread it doesn’t have any hint of “this is kind of a joke” so that’s on me.

                  I am strongly in favor of diversity of browsers, but like CSS coming from Microsoft’s dominance, it’s possible for the de facto leader to use their position to improve the situation for everyone. UA strings are bad and little-to-nothing is gained by continuing to use them (except for interoperability); either we should freeze them and make it a specified string, or they should be removed entirely.

                  I don’t like code churn or breaking changes but I also think infinite compatibility leads to bad code and the inability to write new conforming implementations (see the above link about the failures of the Robustness Principle, or Microsoft Excel’s awful date type maintaining compatibility with Lotus 1-2-3 to the detriment of everyone).

                  1. 1

                    Ah fair enough - I’ve had the occasional joking comment be read as serious :)

                    User agents are a challenging thing though simply because so many existing sites use them that they can’t simply be removed. I did think all the browsers agreed that only the version numbers would change from now on, but I don’t know how serious that was

                  2. 2

                    It’s too easy to make mistakes with UA strings. We could live in a world: If you need a feature, check whether it’s there. If a feature is there but not up to spec, it should be fixed.

                    1. 1

                      There are some bugs that can’t be reasonably detected and so the best option is a version check. The problem is that the majority of developers who look at the user agent are doing it instead of feature checks :-/

              2. 10

                In Chrome, the backup plan is to use a flag to freeze the major version at 99 and report the real major version number in the minor version part of the User-Agent string

                jesus christ

                1. 3

                  my favourite bit from that is they are also monitoring for possible breakages from it being a minor number. this whole thing is a bit hilarious to me.

                  Chrome is also running experiments to ensure that reporting a three-digit value in the minor version part of the string does not result in breakage, since the minor version in the Chrome User-Agent string has reported 0 for a very long time

                2. 5

                  I do recall many years ago when a bunch of sites broke in safari 2.0.4 because a host of sites used UA.indexOf(4) to identify Netscape 4, and if found would try to use Netscape’s layout system (jss or something I think? They all broke due to the lack of window.layers or some such)

                  1. 4

                    I hope every website that is affected by this gets what’s coming to them, good and hard.

                    1. 4

                      We live in a fallen world.

                      1. 2

                        Can we have a nightly study for “User-Agent: lol”? :)