alt text

Caption

Web dev: What browser is visiting the page?

User agent string:

A screenshot of a browser. The URL bar reads firefox://settings, a button on the URL bar is labelled Netscape, a popup from the button reads: “You’re viewing a secure Opera page”, and the web page title reads “Chrome settings”.

  • @dan@upvote.au
    link
    fedilink
    16
    edit-2
    2 hours ago

    User agents are essentially deprecated and are going to become less and less useful over time. The replacement is either client hints or feature detection, depending on what you’re using it for.

  • @OpenStars
    link
    English
    156 hours ago

    Is it… (scrolls wheel of browsers) Lynx?

      • @deltapi@lemmy.world
        link
        fedilink
        33 hours ago

        What’s so insane about it? Web browsers are an evolution of the old gopher protocol. All this stuff has roots in text consoles.

  • @apprehentice@lemmy.enchanted.social
    link
    fedilink
    English
    749 hours ago

    Functionally useless. With the web standardized, we shouldn’t need user agents anyway. It would be more beneficial to ask “do you support X, Y, and Z?”

    • @dan@upvote.au
      link
      fedilink
      94 hours ago

      That’s exactly what you’re supposed to do with the modern web, via feature detection and client hints.

      The user agent in Chrome (and I think Firefox too) is “frozen” now, meaning it no longer receives any major updates.

    • Maestro
      link
      fedilink
      248 hours ago

      It’s called feature detection and it goes a long way back, even before Modernizr popularized it.

      • Gamma
        link
        fedilink
        English
        35 hours ago

        Popularized? That gets less than 100k downloads a week

        • @dan@upvote.au
          link
          fedilink
          4
          edit-2
          4 hours ago

          Most developers just write their own feature checks (a lot of detections are just a single line of code) or use a library that polyfills the feature if it’s missing.

          The person you’re replying to is right, though. Modernizr popularized this approach. It predates npm, and npm still isn’t their main distribution method, so the npm download numbers don’t mean anything.

          • Gamma
            link
            fedilink
            English
            14 hours ago

            Neat, thanks for clarifying! I’ve never heard of it

    • Xanthrax
      link
      fedilink
      5
      edit-2
      6 hours ago

      Web UI for touch screens is a lot different than keyboard and mouse. I still switch to desktop most of the time because the mobile site will lack critical info, though. They “have” to streamline the experience for mobile, but I hate it when they fully remove features.

    • @Quacksalber@sh.itjust.works
      link
      fedilink
      148 hours ago

      Youtube currently (for weeks now) does not work on Firefox, if you don’t use a Firefox user agent. Google doing sketchy things again.