5 ms·
> On top of those privacy issues, User-Agent sniffing is an abundant source of compatibility issues, in particular for minority browsers, resulting in browsers
by ChrisSD 7y ago
> On top of those privacy issues, User-Agent sniffing is an abundant source of compatibility issues, in particular for minority browsers, resulting in browsers lying about themselves (generally or to specific sites), and sites (including Google properties) being broken in some browsers for no good reason.
> The above abuse makes it desirable to freeze the UA string and replace it with a better mechanism.
UA sniffing should have died out a long time ago. It's frustrating that it's 2020 and I'm still having my browsing experience broken for no other reason than the site doesn't like my UA.
- DJBunnies 7y agoI have some news for you about what year it is.
- gsich 7y agoDon't use $current_year argumentation.
- interfixus 7y agoDon't don't.
- wruza 7y agoIt is a subjective version of “too long not fixed”. Like gp remembers this exact problem in 1980/1990/2000 and still there it is. A specific year has nothing to do with it. So come on, it’s 2020 and we still have to explain idioms to each other :)
- sebazzz 7y agoUser agent sniffing is still sometimes required. Take the SameSite bugs that Safari had. On the server you needed to act on that based on User Agent sniffing.
- Macha 7y agoI also remember a CSS bug Safari 4 or 5 had with tables and touch scrollbars that we had to resort to UA detection for - it's not always possible to feature detect bugs.
- vdnkh 7y agoAgreed. For media streaming UA sniffing is required because of quirks each browser has in decoding media. Safari has a few quirks about the MP4 packaging it likes via MediaSourceExtensions. Firefox's network stack includes a delay not related to the actual request because of its implementation[0] which makes timing of small downloads very inaccurate. None of these differences are discernible except by UA. [1] I believe FF includes in the download length the time a request spends sitting in the request queue, but I can't exactly remember.
- anoncake 7y agoBrowsers have those quirks because web designers work around and hide them.
- xfalcox 7y ago> SameSite bugs that Safari had Safari has SameSite bugs and it's infuriating that after years they don't even update the bug reports, let alone fix those. https://bugs.webkit.org/show_bug.cgi?id=200345 https://bugs.webkit.org/show_bug.cgi?id=200345
- jerf 7y agoI think it's distinctly possible that the current status quo may cause an overreaction. Feature detection is good. But we may also need the ability to do specific version checking sometimes. What I think would be best is two things: A feature advertising string (preferably with some versioning in itself), and a new User Agent string that is just that: The user agent. As in, "This is Firefox 72.2.813". Maybe the OS in there too. I think a non-trivial part of the problem with the UA today is "Hey... I'm Firefox. Also, I'm Mozilla. Also, I'm edge 3, and Internet Explorer 6, and today I think I'm also Chrome. Also, I may be a monkey with a banana plugged in to an ethernet cable." Part of the problem is that people abuse the user agent, but part of the problem is that the user agent string is also a pack of outright, outrageous, self-contradictory lies. A truthful field may still have significant utility. One of the things I've learned over the years in software engineering is that you should do you best to make sure that your system doesn't contain lies, or, failing that, treat them like any other issues that you should contain at the edges rather than letting it run riot through your system. For instance, if you decide to let customers have 10GB of bandwidth free before you start charging them, you should never accomplish that goal by tweaking the bandwidth counting system to report 7.5GB of usage as 0GB. That is a lie. Tell the truth about the usage and let the billing system apply the discount, which is itself a truth as well. You always pay for lies in the system in the long run. It is a very common pattern in coding as well where some function author figures out how to assemble the correct lie to some other function to make it do what the author things they want, but in the long run you're better off telling the truth and fixing the code to work with the truth. Otherwise, well, you really do end up with a tangled web of code. Which is... exactly what we've gotten with UA-detection-based code. We won't necessarily get the same mess if there's a new UA that isn't a lie. I'm not claiming this will lead to utopia. Minority forks of popular browsers will fail to pick up the necessary ad-hoc bug fixes this way, for instance. My claim is more like in the long run, the best thing for everybody is just to have a user agent that tells the truth, even if on occasion in the short term you experience occasional problems. (One way to at least partially achieve this is to standardize the new truthful agent string to something like (\w+) ((\d+.)+\d) (\w+), and specify it as "non-conforming true user agent strings MUST be entirely rejected and treated as being absent", so anyone who tries to be Firefox and Chrome and also a monkey ends up being nobody in particular.)
- dTal 7y agoOf course, when the User Agent sniffing messes up, you're perfectly free to change it, and see what else you can get the server to send you. Can you still do that with whatever crazy "feature detection" replaces it?