159 points · by CrazedGeek · 6y ago · 106 comments
The HTML spec already requires all browsers to report themselves as Netscape in the Netscape-era `navigator` object:
appCodeName - Must return the string "Mozilla".
appName - Must return the string "Netscape".
product - Must return the string "Gecko".
So a few more "oopses" from Google products and the next spec will end up saying: User-Agent - Must be equal to the string "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79"This is exactly the right way to solve the problem. The UA header isn't going away because of Legacy. Pin it to an arbitrary generally accepted value and be done with it. The best part about this is that any client-side developer can implement this solution unilaterally... and Vivaldi now has.
Have you ever used a service that shows things like your active sessions, login attempts etc? Notice how they basically all show you what kind of device and usually what browser the session/login is from, with a date time and usually location?
If everyone pretends to be Chrome what's the fucking point any more? "You logged in from Chrome on Tuesday the 3rd at 8am". "Well no I fucking didn't, I guess I better go reset my damn passwords again".
You should totally trust your client to show stuff to the user. And you can generally trust your client when giving you user data, in the sense that you can trust that the data came from the user. (Unless the client is hacked by third-parties or buggy.)
Basically, you can trust your client as much as you can trust your user. Not more.
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.99 Safari/537.36 Vivaldi/2.9.1705.41
is almost laughable for a strange collection of historical reasons. The history of UA strings has come up before here:
https://news.ycombinator.com/item?id=16525559
When is a browser going to just ditch the cruft and present something sensible?
Was anything like that considered during the http/3 design process?
(I saw the linked "client hints" proposal in the article, but that doesn't mention the idea of completely dropping the header from client requests and assuming a certain baseline value for http/3.)
I don't remember if HTTP/2 (and presumably /3) has a initial dictionary for header compression, they could have a suggested value in there, so if you want to look like a browser, you can use that at a low byte cost.
Mozilla/5.0 (X11; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0
Only, er, half of the version numbers are lies...
Better still, ditch the UA string entirely. The only thing that will force website developers to write cross-browser compatible progressively enhanced websites and apps is being forced to detect features and test in all browsers instead of just whitelisting Chrome based on the User Agent.
User Agent strings are bad for the web.
The obvious way to make that happen is a law. Just prohibit the user agent string from being sent, starting with browsers that are distributed after a certain date.
Perhaps a bit of voluntary cooperation is possible. It worked for webassembly.
Deceptive speech is regularly curtailed by the government (eg. fraud, deceptive advertising)
Even if the user frees-up some space on their device, not enough to upgrade to iOS 13.x, but enough to run our app theoretically, our app still fails to run for them. Uninstalling and reinstalling the native app that contains the webview that runs our web app doesn't solve the problem either. My theory is that there are truncated versions of some of our javascript files left over from when the device ran out of storage that don't get re-downloaded even when storage is later made available....
I've been telling people to free-up space on their device and upgrade it to iOS 13 to fix the problem. I sure hope that works...
If all user agents become a fixed string, how on god's green earth will we troubleshoot problems reported by users? I sure hope we get another header that will tell us the real client platform information so we can eventually repeat this exercise after another few years...
This scenario is complicated, but my point is really that of course we need a User Agent to accurately tell what platform the client is running for entirely legitimate reasons and mega corporations should not do patently evil things to make the lives of developers and support people even more frustrating than they already are. There should be laws against things like this. It really is fraud to change something like the User Agent string to a constant value that is incorrect, and it WILL lead to damaging events in real people's lives if it happens. People could be fired for being led down the wrong investigative path when troubleshooting problems. From the article, it sounds like significant damage has already been done.
Of course, if I choose to call you for support I probably would not continue to hide what platform I'm using, that'd be silly. I wouldn't report an issue with false information.
Their app does not have any kind of dependency on iOS 13 and should work on iOS 11. It's just that there's a correlation between an iOS 11 UA and the app not working. The hypothesis is that there is something wrong with some devices that both a) caused them to not be upgraded, b) causes their app to fail.
This kind of misreading is a prime example of just how toxic any discussions about version number detection are. Rather than give the OP any benefit of the doubt and maybe re-read what they wrote, you've just decided they must be incompetent or lazy and castigate them over it.
I even began my sentence stating that I didn't understand. What more do you want? I was genuinely interested, there's no need to snark. The only thing that's toxic in this thread is your comment.
If we're going to begin by assuming that things like "I don't understand" are meaningless hollow phrases that trolls tack on comments just to snark more effectively, then the end is that we simply can't communicate online anymore. Please don't push in that direction, it's not the solution.
> you've just decided they must be incompetent or lazy and castigate them over it.
I did no such thing and I'm genuinely angry at you for suggesting it.
So I changed my UA to a Mac and got online without it.
If we had no way of detecting between browsers that would lead to a much more consistent cross-browser experience in the long run and not allow one browser's dominance to affect the internet experience for the rest.
- identifying active sessions
- working around bugs in specific versions of a browser/os
- changing UI to match the native experience of a user
- seeing percentage of users using different browsers (which is important to know if you can use new features in web apis)
- etc.
First step would be for all browsers to send the same UA. Once it becomes completely meaningless, nobody will read it any more and we can drop it permanently.
However, what if the latest Firefox or Chrome would just have a user string "Chrome/80.0 (Windows 10; Win64; x64)"?
And if you run into a problem you get a button that reverts to the old horrible piece of junk.
Now that robots.txt is established and security.txt is almost there, the next thing we need is a contact.txt that browsers can use to offer a button that will allow sending bug reports to webmasters without having to search the site for the contact address.
Vivaldi has to mimic Chrome because otherwise Google throws errors.
It's not that Google is unaware that there are browsers or that Vivaldi is not Chrome.
Why not choose a FF UA string then? At least they would be doing the world a favor!!
Being able to vaguely confirm the type of device someone uses can help in basic troubleshooting (particularly related to e.g. noticing unauthorised account access).
Using the user agent string to identify web technology compatibility was and is a huge mistake.
https://bugs.chromium.org/p/chromium/issues/detail?id=571722
which is blocked by
https://bugs.chromium.org/p/chromium/issues/detail?id=595993
which is blocked by
https://bugs.chromium.org/p/chromium/issues/detail?id=963260
Also it wouldn't set the User-Agent on top level page loads, just on XHRs/fetches.
XHR/Fetch can only read data from the same origin (unless there are CORS headers allowing cross-origin). AIUI, since it's generally the same origin, there generally shouldn't be any User-Agent problems, because the team making the calls is the same team controlling the server-side code. So spoofing a different User-Agent for compatibility shouldn't be necessary.
I use Brave a lot when I'm using a Chromium-based browser; perhaps when the SDK comes out, Vivaldi will integrate BAT [1]. It would also be nice if Vivaldi got Brave's features like built-in Tor and IPFS.
[1]: https://www.cnet.com/news/braves-privacy-focused-ads-to-spre...
If your only goal is compatibility and thats the only thing you care about, using Chrome is the choice.
* Yes, I know that Edge is now based on Chromium. But given the two, it's better to pretend to be your parent browser, rather than a sibling.