I don't understand why so many websites use user-agents to verify compatibility

Off-topic discussion/chat/argue area with special rules of engagement.
Forum rules
The Off-Topic area is a general community discussion and chat area with special rules of engagement.

Enter, read and post at your own risk. You have been warned!
While our staff will try to guide the herd into sensible directions, this board is a mostly unrestricted zone where almost anything can be discussed, including matters not directly related to the project, technology or similar adjacent topics.

We do, however, require that you:
  • Do not post anything pornographic.
  • Do not post hate speech in the traditional sense of the term.
  • Do not post content that is illegal (including links to protected software, cracks, etc.)
  • Do not post commercial advertisements, SEO links or SPAM posts.
We also ask that you keep strongly polarizing topics like politics and religion to a minimum. This forum is not the right place to discuss such things.
Please do exercise some common sense. How you act here will inevitably influence how you are treated elsewhere.
User avatar
daemonspudguy
Fanatic
Fanatic
Posts: 131
Joined: 2020-04-22, 18:47
Location: Marietta, Ohio, USA, North America, Western Hemisphere, Earth, Milky Way, Universe, Multiverse

I don't understand why so many websites use user-agents to verify compatibility

Unread post by daemonspudguy » 2024-04-30, 20:03

It's never made sense to me. I've had a user-agent spoofer installer on my browsers for years now to get around the issue, whether it be websites not liking the fact I use Firefox, not liking the fact I use Linux, not liking the fact that the web browser I currently use is based on Firefox ESR (yes, really), or a whole bunch of other reasons. Changing your user-agent is trivial, and it's never been a way to verify anything. Maybe this is just me using my head again like you're apparently not supposed to do in modern web design.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 37762
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: I don't understand why so many websites use user-agents to verify compatibility

Unread post by Moonchild » 2024-04-30, 21:22

They do it because it's easy, and no amount of advice on the Internet has done away with webmasters preferring an easy string comparison check over feature detection.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
RealityRipple
Keeps coming back
Keeps coming back
Posts: 862
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California

Re: I don't understand why so many websites use user-agents to verify compatibility

Unread post by RealityRipple » 2024-04-30, 22:12

It's not always the case, but often, such distinctions are made depending on if the code to serve or run a script is client-side or server-side. Server-side checks are usually done on the initial request, before any client-side script to check for the existence of a function can be run. What's served is manipulated to fit the expected client that sent the agent. The thought is in the right place; don't send the client things that it won't be able to run anyway. It's just based on a bad premise.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 37762
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: I don't understand why so many websites use user-agents to verify compatibility

Unread post by Moonchild » 2024-05-01, 00:28

RealityRipple wrote:
2024-04-30, 22:12
don't send the client things that it won't be able to run anyway.
While that's a good idea in principle, it's not practical when you go into the intricacies of which version/iteration of which browser you're targeting. That kind of thing works for overall file support, maybe, and I am still a big proponent of the content negotiation idea in that respect (where the client sends capabilities with its request, prior to the server sending anything) but that kind of fine granularity on moving target specs in JS simply can't be done server-side -- which is literally why this whole "only these 5 browsers and only the latest version on only these O.S.es" discrimination came into being. It's just a Bad Idea™ to try and do that server-side, even more so because to do it correctly, one has to maintain a long and detailed list of all possible web clients and versions leading once again to "your browser is not supported" if webmasters don't want to maintain their site that way.
There are flexible solutions in JS for this kind of thing that don't discriminate - or mis-detect based on arbitrary strings - but people are just not using them because anyone can write a string comparison in 5 minutes and call it a day.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Pentium4User
Board Warrior
Board Warrior
Posts: 1327
Joined: 2019-04-24, 09:38

Re: I don't understand why so many websites use user-agents to verify compatibility

Unread post by Pentium4User » 2024-05-01, 05:49

Moonchild wrote:
2024-04-30, 21:22
They do it because it's easy, and no amount of advice on the Internet has done away with webmasters preferring an easy string comparison check over feature detection.
And most of them only care about Chrome (and the derivates), Safari and maybe Firefox. They are not interested to provide compatibility.
The profile picture shows my Maico EC30 E ceiling fan.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 37762
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: I don't understand why so many websites use user-agents to verify compatibility

Unread post by Moonchild » 2024-05-01, 10:38

Pentium4User wrote:
2024-05-01, 05:49
Moonchild wrote:
2024-04-30, 21:22
They do it because it's easy, and no amount of advice on the Internet has done away with webmasters preferring an easy string comparison check over feature detection.
And most of them only care about Chrome (and the derivates), Safari and maybe Firefox. They are not interested to provide compatibility.
The thing is... it could be hands-off if they would settle on standards and work within the confines of what is established in them. You wouldn't need to target individual browsers, just an overarching compatibility against those standards. But since there's still a "browser war" because of money, this will remain a pipe dream.
We had some semblance of this in the past, actually. the good old HTML4 days.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 5605
Joined: 2015-12-09, 15:45

Re: I don't understand why so many websites use user-agents to verify compatibility

Unread post by moonbat » 2024-05-02, 00:49

Moonchild wrote:
2024-05-01, 10:38
You wouldn't need to target individual browsers, just an overarching compatibility against those standards.
The great thing about standards is that there's so many of them.
:coffee:
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net

User avatar
RealityRipple
Keeps coming back
Keeps coming back
Posts: 862
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California

Re: I don't understand why so many websites use user-agents to verify compatibility

Unread post by RealityRipple » 2024-05-02, 05:25

Image

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 37762
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: I don't understand why so many websites use user-agents to verify compatibility

Unread post by Moonchild » 2024-05-02, 08:37

Wrong approach. If standards conflict, solve the conflicting issue (you know, by putting your heads together and deciding which behaviour is most desired), and not "just go off and create another distro standard without saying anything" and hoping it somehow gets more traction than the "competition". It's one of the places where democracy would really solve everything.
But that's more wishful thinking, since people would rather have conflict than cooperation.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
frostknight
Astronaut
Astronaut
Posts: 593
Joined: 2022-08-10, 02:25

Re: I don't understand why so many websites use user-agents to verify compatibility

Unread post by frostknight » 2024-05-03, 00:51

Moonchild wrote:
2024-05-01, 00:28
There are flexible solutions in JS for this kind of thing that don't discriminate - or mis-detect based on arbitrary strings - but people are just not using them because anyone can write a string comparison in 5 minutes and call it a day.
So basically its a, I want to be lazy excuse.

This is why I detest the modern web. Its all based on either money, stupid egos and laziness.

It isn't about putting the best standards forward.

Would be nice if the web was ripped out of the shackles of these rich a-holes.

IE, True net neutrality should be put into place where the standards put into place is based on democracy not greed or selfishness and especially not egocentric people.
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Say NO to Fascism and Corporatism as much as possible!
Also, Peace Be With us All!

Eduardolucas1
Apollo supporter
Apollo supporter
Posts: 43
Joined: 2024-02-05, 03:15

Re: I don't understand why so many websites use user-agents to verify compatibility

Unread post by Eduardolucas1 » 2024-05-03, 07:39

frostknight wrote:
2024-05-03, 00:51
Moonchild wrote:
2024-05-01, 00:28
There are flexible solutions in JS for this kind of thing that don't discriminate - or mis-detect based on arbitrary strings - but people are just not using them because anyone can write a string comparison in 5 minutes and call it a day.
So basically its a, I want to be lazy excuse.

This is why I detest the modern web. Its all based on either money, stupid egos and laziness.

It isn't about putting the best standards forward.

Would be nice if the web was ripped out of the shackles of these rich a-holes.

IE, True net neutrality should be put into place where the standards put into place is based on democracy not greed or selfishness and especially not egocentric people.
Democracy (true democracy) means indirect (representative) or direct (participatory) inclusion of the most of the users who are able to exert their right (i.e knowledge and/or experience) into the process. For these guys, democracy means a part of the shareholders and CEOs playing together to decide things. The only way to fix that is antitrust and industrial regulation by the state, something that do not interest them and that many countries would refuse to do, some even if they asked.

User avatar
frostknight
Astronaut
Astronaut
Posts: 593
Joined: 2022-08-10, 02:25

Re: I don't understand why so many websites use user-agents to verify compatibility

Unread post by frostknight » 2024-05-03, 22:37

Eduardolucas1 wrote:
2024-05-03, 07:39
Democracy (true democracy) means indirect (representative) or direct (participatory) inclusion of the most of the users who are able to exert their right (i.e knowledge and/or experience) into the process. For these guys, democracy means a part of the shareholders and CEOs playing together to decide things. The only way to fix that is antitrust and industrial regulation by the state, something that do not interest them and that many countries would refuse to do, some even if they asked.
Yes... which is why those countries who refuse to do this, should be given the middle finger by every non-shareholder and/or citizen.

And if they refuse to do something, they should be banned from the office of power forever. Same with every human being who has power.

The shareholders should have their riches ripped from their hands for supporting data collection and/or monopolies on the web.

As of now, there is no way forward, to fix this though, I will agree with you there.

It would take a friggin uprising against antitrust bs. That's a long ways away.

Hopefully the planet doesn't die due to all the data collection centers wasting water, otherwise, yes, nothing will ever change.

I detest powerful people who are arrogant and think they should have a say in everything. The truth is, those same powerful people who think that deserve LITERALLY NOTHING OF VALUE.

This kind of stuff irritates me, as you probably can tell from my last sentence.

Anywho, venting seems to be all I can do currently.
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Say NO to Fascism and Corporatism as much as possible!
Also, Peace Be With us All!