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?"
Programmer Humor
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
It's called feature detection and it goes a long way back, even before Modernizr popularized it.
Popularized? That gets less than 100k downloads a week
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.
Neat, thanks for clarifying! I’ve never heard of it
It used to be huge.
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.
I know Safari 15.3 doesn’t support feature Y, but I also know the current version does. Now I want to know if I can just use the feature or if I need to program around Safari 15.3. It would be nice to just look at the server logs from last month and see if someone still uses it.
"yer a jedi, harry" - Gandalf
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.
Is it... (scrolls wheel of browsers) Lynx?
I'm still amazed at how usable Lynx is, given the insane premise of the application.
A URL is not an agent string, just saying.
A new browser touches the beacon
I want a WordPress plugin that refuses to load my site for anyyhing newer than Netscape 3 and pops up a modal "you need to upgrade your browser" pane.
There are some use cases other than web page compatibility. One for me is in dealing with firewall and proxy policy, if the agent is a browser and comes in on specified explicit ports then force authentication, things of that nature.