116 pointsby nan605 days ago10 comments
  • gnabgib5 days ago
    (2008)

    The post popular answer includes: History of the browser user-agent string related discussions:

    2022 (87 points, 20 comments) https://news.ycombinator.com/item?id=31246438

    2019 (62 points, 22 comments) https://news.ycombinator.com/item?id=21085388

    2018 (558 points, 168 comments) https://news.ycombinator.com/item?id=16525559

    2013 (100 points, 32 comments) https://news.ycombinator.com/item?id=6674812

  • impure5 days ago
    Mozilla should start charging a licensing fee for starting your user agent with Mozilla/ Money problems solved!
    • wvbdmp5 days ago
      In a way it seems like a classic trademark violation, tricking people (or their servers) into thinking your product is someone else’s. I wonder if there are actual agreements about this these days.
      • wmf5 days ago
        User agent strings aren't really seen by people so arguably there is no consumer confusion. And if you need the Mozilla user agent for compatibility it's reminiscent of https://en.wikipedia.org/wiki/Sega_v._Accolade
      • rileymat25 days ago
        The mark in this usage has gone unprotected for so long, I doubt there would be any success with that.

        Also, I doubt tricking servers would indicate creating consumer confusion with the trademark.

        • ojosilva4 days ago
          Yeah, but the case law resulting from the denied ruling could prove valuable for others who need to defend their use of trademarks in API naming. "API" here refers to the broad judicial term, where the User-Agent header falls under.
      • userbinator5 days ago
        See Sega v. Accolade for a precedent of why that likely won't work.
      • im3w1l5 days ago
        Adversarial compatibility is pretty nice though, I don't think we should do away with it.
    • brunoarueira5 days ago
      One of the comments from the accepted answer says that the Mozilla was the codename for Netscape, link: https://stackoverflow.com/questions/1114254/why-do-all-brows...
      • Rediscover4 days ago
        There's a better explanation in the last comment on the page You linked.

        ISTR that Netscape used to have in it's README or INSTALL (or maybe an "about"-like menu entry) a note that the name of the browser is pronounced Mozilla while only being spelled N-E-T-S-C-A-P-E.

    • 1vuio0pswjnm74 days ago
      Maybe then folks would stop sending this header. To avoid licensing fees.

      I have been omitting it for decades with great results.

    • GuB-425 days ago
      Google would have to pay a lot of licensing fees then...

      > Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36

      It is Mozilla (nope), Linux (yes, in a sense), Android (yes) AppleWebKit (not Apple and not WebKit), KHTML (nope), Gecko (nope), Chrome (yes), Mobile (yes), Safari (nope).

      So maybe they owe something to Mozilla, Apple and KDE.

      • rtyu11204 days ago
        To be fair Blink engine started as a fork of Apple's WebKit engine. Although I wouldn't be suprised if none of the WebKit code is present on Chromium now...
        • const_cast4 days ago
          And to be fair on the topic of being fair, Apple's WebKit started as a fork of KHTML. So the string makes some sense.
  • technothrasher5 days ago
    Not all browsers (e.g. "Lynx/2.9.0dev.12 libwww-FM/2.1") :)
    • Rediscover4 days ago
      And all heavy lynx users know about changing that on the fly to Mozilla for screwy websites that claim they won't work with lynx. I'm happy that I am encountering such behavior less and less over time.
    • the_third_wave5 days ago
      Not to forget SpaceGoat/2000, my usual go-to when building something which does browser-like things. I've been using that one since before the year 2000 so maybe it is time for an upgrade to SuperSpaceGoat/2100?
  • RainyDayTmrw5 days ago
    In a similar way: Why was there no Windows 9? [1]

    [1]: https://www.pcworld.com/article/435584/why-windows-10-isnt-n...

    • Nition4 days ago
      My pet theory was that they wanted to stay on the next version indefinitely but Mac OS seemed to be indefinitely on version 10, and they couldn't be one behind. Funnily enough, soon after Mac OS went to version 11, Windows 11 was announced.

      (realistically though, the '9x' problem does make a lot of sense)

    • chuckadams5 days ago
      An alternate reason that doesn’t require such stretching of credulity around one broken piece of software is that MS already had two products starting with “Windows 9” and that people were likely to confuse them, whether end users or someone updating a catalog.
    • uxjw5 days ago
      TL;DR: Some code looking for Windows 95 or 98 only looked for "Windows 9" to match both, and would have matched Windows 9.

      Now Apple has the year in the OS version we'll have people wondering in a few years what happened to iOS 19-25.

      • DecentShoes5 days ago
        [flagged]
        • danielheath5 days ago
          I worked on a codebase that had this bug, so I’m not sure where you’re getting “this is false” from.

          We sold software that was installed long-term at customer sites, and they weren’t going to update it until they needed to, so the bug persisted in production well after we fixed it.

          • Johnbot5 days ago
            Best I can tell it's only libraries that generate those sort of strings, which could just as well report a different string for Windows 9. The actual Windows API even returns the version information for Windows 8 if the application isn't manifested for 10 and onwards.
            • danielheath4 days ago
              Company I joined in 2008 had sold software back in 2005 or so which had the bug, and customers were still running it in 2015 when Win10 came out.

              The idea that "sensibly designed software wouldn't have this issue, so it must not exist" is absolutely at odds with virtually everything I've seen in my career.

    • DecentShoes5 days ago
      [flagged]
      • Gigachad5 days ago
        There’s also no reason that the public facing name has to be the same as the internal name. They could have called it Windows 9 and internally reported it as anything in the apis.

        Its basically standard in software to do this when the actual name for something comes out near the end or changes often so you don’t have to update all the code to reference the new name.

        • bigfatkitten5 days ago
          > There’s also no reason that the public facing name has to be the same as the internal name. They could have called it Windows 9 and internally reported it as anything in the apis.

          This is what they were doing at the time anyway.

          Windows 7 was 6.1, Windows 8 was 6.2, Windows 8.1 was 6.3.

          • rezonant5 days ago
            And still to this day, where Windows 11 is for instance version 10.0.26100
        • hshdhdhj44444 days ago
          The concern was about apps from the 90s.

          Those were very poorly written apps. They very well could simply have been using APIs that returned the consumer oriented names.

          These are custom apps running on a specific set of computers in places like banks, stores, government offices around the world, etc.

        • djxfade4 days ago
          This is what Apple did when they finally dumped the OS X branding. macOS 15 also reports as 10.15.
  • anamexis5 days ago
    Has anyone tried running a generic User-Agent on a standard modern browser? (By "generic", I mean one that does away with this whole compatibility dance.) I'm curious how much would break or degrade.
    • ryao5 days ago
      I once tried having my web browser claim to be the Google spider. It worked well and I completely forgot about it until one website soft banned me a year or two later for impersonating the Google spider. I contacted them to complain. They lifted the ban and told me the ban reason, which made me remember the experiment I never terminated.
    • arp2425 days ago
      Opera Presto didn't use it, and had a User-Agent like:

        Opera/9.80 (X11; Linux zvav; U; en) Presto/2.12.423 Version/12.16
      
      Didn't seem to cause that much problems.

      It did keep the version at 9.80, presumably because >=10 must have caused problems somewhere.

      • sunaookami4 days ago
        God I miss Presto... but Opera did have major compatibility issues even when it was still popular.
    • userbinator5 days ago
      Unfortunately, everything that does fingerprinting/"bot detection" will get triggered.
      • Gigachad5 days ago
        All of the privacy stuff straight up breaks the internet these days. Try using a VPN and half the time CDNs straight up refuse to serve you the JS files so sites like supermarkets or flight booking websites load broken or show some generic forbidden error.

        Blanking out the user agent would have to be pushed by either Apple, Google, or Microsoft. And out of those I feel like only Apple would do it. iCloud private relay doesn’t end up breaking websites since companies care about not degrading the experience for Apple users and make sure the site still works.

    • chjj4 days ago
      I tried doing that in the early 2010s. Even back then it didn't work (github broke for example). If you did it today, you'd likely be blocked by a lot of major websites for "lying" about your user agent. Cloudflare turnstiles will stop working, you'll get captcha'd to death, and so on.

      Even tor-browser doesn't dare to modify the user agent string in any major way. It's almost impossible to lie about because trackers don't actually care about your user agent. They're identifying your device/OS through side channels (canvas, webgl, fonts, etc).

      • npteljes4 days ago
        Wrt/ Tor browser, it's not that they don't dare to, it's that they don't want to. One of the goals of that browser is to not stick out too much, and changing the user agent would do just that, so they don't do it.
        • chjj4 days ago
          Then the ideal would be to normalize the user agent string to look identical on every platform. My point is: they can't do that. e.g. A linux machine identifying itself as windows would be spotted immediately. Instead, they have to reduce entropy by bucketing you according to your device/OS/arch.
          • npteljes4 days ago
            I don't think there is a point there. In case of the Tor browser, they use the user agent to blend in, so they are not a good candidate to do anything about how stupid the user agent is.

            It's the current heavyweights who could change it for the better: Google and Apple. If either introduced a major change in how they present the user agent, websites would be very quick to adapt (if they need to in the first place...), or else. Otherwise, no change will happen - and I think this will be the case, same as with the HTTP "Referer" (misspell of "referrer").

            Fun fact, non-browsers actually have much nicer user strings. I run an internet radio, and there is a lot of clients like

            Linux UPnP/1.0 Sonos/85.0-64200 (ZPS1) Nullsoft Winamp3 version 3.0 (compatible)

            Echo/1.0(APNG)

            NSPlayer/8.0.0.3801

            mpg123/1.20.1

            • chjj3 days ago
              > In case of the Tor browser, they use the user agent to blend in, so they are not a good candidate to do anything about how stupid the user agent is.

              No. They don't use it to blend in. If they wanted to blend in they would be modifying every platform's user agent string to look like Windows x86_64 or something. They don't do that because there's no way they could possibly get away with it.

              Instead, they're resigned to simply censoring the minor version number of the browser to reduce entropy.

              > Fun fact, non-browsers actually have much nicer user strings. I run an internet radio, and there is a lot of clients like

              And those tools will get blocked by various CDNs for not having a browser user agent string, not having a browser-like TLS handshake, etc. This is why projects like curl-impersonate and golang's utls had to be created.

              • npteljes3 days ago
                >They don't do that because there's no way they could possibly get away with it.

                Yes indeed. They use it to blend in. What they want is to not stick out, so, they act like the rest of the browsers do.

                Just like the tools you mention, curl-impersonate and others.

                Bravery, daring, could only be done my market leaders here. Google and Safari. The rest of the guys just follow suit.

  • dankwizard4 days ago
    It's funny, UserAgents are only used these days to either A - pretend to be a browser, B - bad actors exchanging decrypts

    why haven't we deprecated this junk

  • usr11065 days ago
    Ironically Cloudflare blocks the real Mozilla derived browser on this Linux phone, so I can't access SO anymore. (Turnstile was broken a long time. It finally got fixed half a year ago. Now I note it does not even come up any more, just a static message that I should throw away my phone^W^W^W^W upgrade my browser. No idea whether Cloudflare or SO is to blame.)
    • userbinator5 days ago
      No surprise, CF is in bed with Big Browser. There are workarounds but I won't go into detail here since "the walls have ears"; suffice to say that the "bot" scraping companies still have no trouble getting around it.
  • shmerl5 days ago
    Really weird and convoluted reasons for it. A better question is why it was never fixed / renamed to proper names.
    • wolrah5 days ago
      > A better question is why it was never fixed / renamed to proper names.

      Because the reason it is the way it is in the first place is compatibility with sites that are doing things objectively wrong already, which makes it really hard to get them to change.

      The problem is that poorly designed systems limit access or disable features based on a user-agent allowlist, which is never the right answer. There is no right way to do it because it's always wrong, but people choose to do it anyways.

      I'm personally a fan of treating broken sites as broken, but I understand that realistically any "alternative" browser has to deal with all the broken sites designed for whatever came before it because otherwise most normal users won't consider switching.

      If I were made King of the Internet for a day and able to enforce any changes I wanted on everyone, all the major browsers would have to change their user-agent string to something totally unique on the same day, intentionally breaking any sites that are doing it wrong for everyone so the broken sites are forced to fix their own nonsense. That'd come maybe two or three decrees down the line from "All ISPs are required to provide a globally routable IPv6 block in accordance with RFC 6177, providing only CGN IPv4 is a capital offense".

      • Gigachad5 days ago
        Personally I’d get rid of the user agent entirely. Stop sending it and let sites query available features rather than check the specific browser version.
        • wolrah4 days ago
          There are valid reasons to want to know the specific user agent when working around bugs in old but popular versions, that's why I said a user-agent allowlist for access or advanced functionality was bad. That inevitably breaks any new platforms that haven't been explicitly approved, which is obviously bad. Denying access from or specifically only applying fixes to known bad versions is fine.

          Also IMO it's useful as an admin to know what clients your users are using, but I do understand why many would prefer to limit the data shared with the sites you visit.

          • Gigachad4 days ago
            The abuse of the user agent for tracking and unreasonably blocking browsers - Chrome only websites that work fine when you spoof the user agent - out weighs the usefulness of being able to work around browser specific bugs.

            These days old browser versions are for most companies, a problem of the past. IE is well and truly dead, and almost all users have auto updating browsers now.

            Websites shouldn't really attempt to fit themselves to the browser, just detect which features are available and if there is some odd browser bug, wait until it's patched if it's affecting a major browser.

      • wombatpm5 days ago
        When my site says Best viewed in Netscape, I mean Netscape Navigator. The rest of the world may have moved on, but static HTML 3.2 with the blink tag is forever.
        • wolrah4 days ago
          Proving my point, user agent allow lists would make it only ever work on Netscape, when the blink tag was supported in Firefox prior to v23 and any of its cousins, as well as Opera prior to v15 (where it switched to Blink and became yet another Chromium derivative). As long as your HTML wasn't total jank dependent on exact bug compatibility with Netscape specifically it should work fine on a wide variety of browsers.
          • wombatpm4 days ago
            I had many fights with IT over coding to standards. They said, we do, our standard is IE 6.

            They earned every ounce of pain for that decision.

    • fredoralive5 days ago
      To avoid breaking stuff basically, easier to have ugly UA strings than persuade every site that does weird UA parsing to fix themselves.

      The main exception to this was Opera back when it had its own engine, which did use Opera at the start of its fairly clean default UA string. Then when they reached version 10 they had to make the primary version 9 with a second real version later in the string as sites couldn’t cope with two digit version numbers…

      • imiric5 days ago
        I miss Opera. It's a damn shame that it was so badly mismanaged, and ultimately sold off to investors, which further buried it into irrelevance. It now survives on gaming-oriented gimmicks and shady promotions. I hear that Vivaldi is supposed to be a continuation of it, but from what I've seen it's just another Chromium clone with a closed-source UI, without any distinguishing features.

        Opera in the late 90s / early 2000s was excellent. It was lightweight and snappy. Among the first to support tabs. The Presto engine was the most performant on machines of the era. The trialware/adware was annoying, but the browser was solid. The built-in email client was decent as well.

        In 2009 they launched a very interesting web server / sharing feature with Opera Unite, which unfortunately didn't gain traction.

        Opera Mini was the best mobile browser for a few years as well, before smartphones took off.

        • FirmwareBurner5 days ago
          >It's a damn shame that it was so badly mismanaged

          I think even the best management in the world wouldn't have helped it survive the onslaught of Google's Chrome and their massive war chest in that time. It's like a team of girl scouts versus the NBA.

          • 5 days ago
            undefined
        • fredoralive5 days ago
          Amen brother.

          My personal big thing was the ability to "minimise" / deque tabs, a legacy of the really early version of tabs that were basically based around the concept of the Windows task bar (and MDI), not tabs. I'm not a Firefox user as it's the least worst option, and there used to be Firefox extensions that mostly (but not quite) did it, but Mozilla naturally broke it as part of their general view that making Firefox worse will somehow make it popular[1].

          Also mouse gestures. Again, you can kinda do it with Firefox, but random stuff like the home shortcut screen don't support it nowadays because???

          Also, I want a status bar. I don't care if it's old fashioned, but I want one.

          Sorry if this is becoming a Mozilla / Firefox gripe fest.

          [1] I don't think Opera had a nice preview view for RSS feeds, but Firefox did. Then they broke it for random reasons? Gee, raw XML is so much better than a sensible view, thank you Mozilla!

    • JdeBP5 days ago
      Possibly, but it wouldn't be the first time that people took a field that was supposed to be an originator name and made it something else entirely.

      There's a field in the Volume Boot Record of disc volumes, in the PC compatible world, that was supposed to be the name of the OEM whose software formatted the volume. It was (and is) a few bytes of identifying human-readable text. Operating systems ended up doing string comparisons and parsing numbers, and breaking in odd ways, including not even recognizing their own handiwork, when operating system vendors did not use the name of the first vendor.

      * https://jdebp.uk/FGA/volume-boot-block-oem-name-field.html

      It has probably been long enough since MS-DOS 3.3 and in turn the Browser Wars that someone is right now failing to learn from history and making this mistake anew, yet again, somewhere.

    • ExoticPearTree5 days ago
      Probably because now if you come with a different User-Agent you might get blocked by a WAF or a load balancer. Too much history to just forget overnight.
    • ronsor5 days ago
      Backwards compatibility at all costs
  • nreilly5 days ago
    Maybe we should move to something like termcap for browsers? /s
  • 5 days ago
    undefined