Version 100 in Chrome and Firefox
hacks.mozilla.org
hacks.mozilla.org
For example, the "canPlayType" API for whether a codec is supported returns "probably" or "maybe". So we sometimes need to hardcode which browsers support which new codecs.
Also, there are several bugs in past and present versions of decoder implementations, which are only discovered though manual testing, or by observing quality of service metrics split by browser version (Firefox does not handle bad audio packets as well as Chrome, for example). In IE and old Edge, the video readyState would always be "4" after playback beings, even during buffering, which is a blatant violation of the spec Microsoft refused to fix (as stated in their bugtracker).
Browsers like Safari have subtly different event orders from the HTMLVideoElement which requires a burdensome workaround that us working in video just like to keep to Safari instead of poisoning other implementations.
A final fun quirk is that not all browsers gave accurate HTTP timing information until recently (notably, Safari < 14) which make download timing for the purpose of determining bandwidth very inaccurate. This is why Twitch only recently supported low-latency playback for Safari. There is no other way to ask "do you support accurate timing" other than for an engineer to test it and hardcode an exception.
The browser also included a built-in user agent compatibility list and the user could manually add sites to use a specific UA string.
Most sites would work fine in Opera with the correct UA. Many did not work when using the default UA with the word "Opera" in it.
A recent success story: Mozilla recently added a UA tweak to work around Slack's Chrome-only check for video calls. Slack engineers reached out to Mozilla and, just a few days later, Slack removed their Chrome check and now support video calls in Firefox without a UA tweak. :)
I wouldn't call that a success.
Welp, better spend a few minutes downloading the same thing but in a Chrome sandbox.
Some of our video test grid machines are Ubuntu, so from our end Twitch video should work pretty well on Linux :-)
Great. You should be calling for the death of UAs too if you want the situation to improve.
random article about it: https://catchjs.com/Blog/SameSiteCookies
- People who have recently run into an issue that required browser sniffing
- People who haven’t and feel sure that “things are better now” and the practice is no longer needed.
I’ve gotten into these kinds of scrapes many times, and I can assure you all that philosophical arguments about browser-detection-vs-feature-detection don’t work very well when you’re trying to explain to a client why their web app that worked a week ago doesn’t work today (due to a WebRTC bug in Chrome, for instance) and won’t be fixed until the next Chrome version comes out in six weeks.
To folks advocating “ripping off the bandage” as a solution, I’d note that the wound underneath has not stopped bleeding.
https://developer.mozilla.org/en-US/docs/Web/API/Media_Capab...
It returns a boolean for whether a codec is supported or not.
However, I also browse the web on Linux, and there are also situations where sites just kind of decide that they do or don't support me based on whether or not I'm in an allow-list that was lazily cobbled together and that hasn't been updated in over a year. This seems to me to be the same category of problem; it should be better, sites should know not to do that, but they don't. And sure, I can solve the problem specifically for myself by going though an annoying process to lie about my user-header, but it's a big damper on all of the other "users" (ie, random family members/friends) that I support who aren't able to do that. And it defeats the primary purpose of the user-agent if I'm lying to sites about it because they block off capabilities for no good reason from agents that they don't recognize. If I'm constantly lying about my browser as the "solution" to that problem, I'm already kind of breaking user-agents in the exact way you're worried about.
And there are also obviously the privacy problems that come along with user-agents, which I'm not going to get into, but they're substantial and there is no way to solve them without making user-agents much less useful for website operators.
So I don't know what the solution is, or even if there is a better solution available than what we currently have, but there are real downsides to the current setup. I think it's silly to pretend that browser vendors won't ever have quirks that make user-agents necessary. But I also think it's equally silly to pretend that website operators will ever use them responsibly, and equally silly to pretend that people won't get locked out of sites for no reason because of them.
There is definitely some naivete in getting rid of user-agents, but there's also some naivete in keeping them, and the arguments for "well, they're still necessary" sometimes ignore just how much wasted effort and hacky crud goes into making the web work with them. At the same time though, there are bugs I've fixed in my day-job that could not be fixed without them. It's just, that doesn't mean the downsides aren't also there and that they don't also matter.
I'm personally interested in how client hints progress. They're not perfect, but they seem to be decent, and for all of my criticism of Chrome's Privacy Sandbox concept, I think this is an area where it makes a lot of sense -- make certain hints possible to check, but have a cost associated. It's still not the exact browser version though, there are still bugs that I wouldn't be able to fix with that system. But there are some bugs that I use user-agents for that this system would work for, and I'm willing to make my job slightly harder if it makes a bunch of other things better. Or at least, I'm willing to see how client hints play out and see how much harder they do or don't make my job.
If sites break, let them break.
For some tightly-controlled environments (medical, aerospace, etc...) where all software components & tooling has to be qualified for use, I can see checking the UA in order to throw up a "your browser is not supported" banner ("not supported usually means "we haven't tested it, so we can't assert this web app will work properly", not so much "our app won't work"). But sites should really avoid responding with different content/html, etc.... for different browsers (though, I have encountered sites that serve images as webp to chrome and jpg to IE...)
This are places where you don't automatically upgrade browsers but keep them at one specific version. No rocket/airplane wants to stop working because something changed.
It is also places which are good at writing contracts that can ensure such things to work, so these places should not be a concern.
It's likely cheap shoddy sites that will be a problem. The ones that think jQuery is too advanced tech.
They were built by a PhD candidate in 2012 and the source has been lost to the mists of time. It's still critical to the research group's workflow though, so they switch to Edge instead of rewriting it . A month later they encounter an article on HN asking "Why is Firefox losing marketshare and how would you save it?"
That's incredibly arrogant, IMO. Imagine the amount of pointless work that would cause world-wide, and the cumulative amount of pain experienced by readers of the web for years.
It's pure value destruction on a global scale, just making things worse to prove a point.
A better solution is to realize that the UA header has been completely broken for decades and do yet another compat hack, whilst transitioning to some more futureproof mechanism.
The web needs a Linus occasionally screaming: don't break things for shits and giggles.
With the Chrome "backup plan" literally everyone will have to modify their code to make it work, making it more convoluted in the process. With the "well, just break stuff then" only the small number of people who relied on a fixed width of the version will have stuff break. This seems like a decent enough trade-off, and will almost certainly save programmer time globally.
I don't understand. If you need to detect a >99 version, then yes, you'll need to update your code, but you'll need to do that anyway, to add your >99 logic in the first place. If you don't need to detect that, then no changes are needed, and as a bonus no poorly-coded sites will break.
The bar was so extremely low, that I'd be OK letting parsers break due to their short sightedness. Not even in embedded space (where I've got some experience to know that computing resources are scarce) this would pass as understandable.
I really hate this narrative. Why should the browsers give a damn? There should be nothing required of the browsers, the only ones to worry are the idiots writing faulty UA parsers and baking in their assumptions.
I know there are arguments that a new version will be abused just as much, but I think we should be able to find ways to elevate that by, for example, limiting the length of different fields so doubling up of information to mask the truth or detect as two different browsers isn't possible.
We could even design this new system specifically to be fingerprint proof, just report the essentials which is pretty much just the browser engine (webkit/blink/gecko) and version. don't even need the actual browser and os.
I can see the use case for this. Maybe in parallel with a simpler header.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Client_hin...
And for in-browser stuff (via JS), you already have an alternative that works perfectly fine, `window.navigator`, that looks something like this:
{
"permissions": {},
"mimeTypes": {},
"plugins": {},
"doNotTrack": "unspecified",
"maxTouchPoints": 0,
"mediaCapabilities": {},
"oscpu": "Linux x86_64",
"vendor": "",
"vendorSub": "",
"productSub": "20100101",
"cookieEnabled": true,
"buildID": "20181001000000",
"mediaDevices": {},
"serviceWorker": {},
"credentials": {},
"clipboard": {},
"mediaSession": {},
"webdriver": false,
"hardwareConcurrency": 8,
"geolocation": {},
"appCodeName": "Mozilla",
"appName": "Netscape",
"appVersion": "5.0 (X11)",
"platform": "Linux x86_64",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0",
"product": "Gecko",
"language": "en-US",
"languages": [
"en-US",
"en"
],
"locks": {},
"onLine": true,
"storage": {}
}
Or is there something else you're missing from window.navigator? "appName": "Netscape",
"appVersion": "5.0 (X11)",
So, without checking the user agent string, window.navigator basically tells me that this browser is Netscape 5.0. How is that helpful?If that was a bug, I'd be pretty suspicious about the general software quality in the rest of the library.
It's not crap, it's just short sighted.
More than just "very expensive". Often, you were limited to exactly 80 columns for each record. If you had for instance three dates on one record, using 2 digits instead of 4 digits saved 6 columns, which is over 7% of the available space.
It just baffles that someone can look at a monotonically increasing number, defined and incremented by a third party, and say "That will never be 3 digits."
A lot of software is written by junior programmers, not infrequently in a hurry. It's an easy mistake to make and if you've been bitten by it once you'll remember it, but many people have never been bitten by it.
"Ok"
if(userAgent.includes("Chrome") && userAgent[whatever] >= 4)
I also fear there’s software that correctly extracts all the digits of the version in the user agent, but then compares it as a string with a given version. That would get you
“100” < “99”Slack's message buttons (such as "Add reaction" or "Reply in thread") stopped working for Firefox versions >= 100 and <= 519. They mysteriously started working again for versions >= 520. The version string "100" compared as smaller than "52" in Slack's code, which activated some kind of webcompat workaround intended for Firefox versions < 52 that breaks on more recent Firefox versions.
Their Xbox went to 360 second, then "One" third then "Series". Like that makes any sense at all.
Then the series would spell out X □ ○ ∆ .
This is ignoring the battery charging, alternate modes, etc. Just the main USB versions.
Steve Ballmer wanted a "One Microsoft", SkyDrive being renamed to OneDrive was partly due to this, and was hoping people would call the XBox One "The One".
Though, I don't find many examples of it and checking individual features for determining whether an API is available for example (doesn't apply to everything, yes I know) right, non-hacky way to go.
prominent example for a browser bug: https://catchjs.com/Blog/SameSiteCookies
The webcompat project has a list of some compatibility issues reported so far: https://webcompat.com/issues?page=1&per_page=100&state=open&...
We all survived the shift from 1 digit to 2 digit, so this seems like way too much trouble.