13 ms·
Browsers identify themselves with a user-agent string, and the user agent strings are a giant disaster of technical debt resulting from a long history of browse
by jimrandomh 11y ago
Browsers identify themselves with a user-agent string, and the user agent strings are a giant disaster of technical debt resulting from a long history of browsers working around buggy websites and websites working around buggy browsers. Browser video is also a giant disaster of technical debt, and YouTube uses the user-agent string to determine which ways of serving video will work and which ones won't. Presence of bugs here is no surprise, and any such bugs will naturally impact some browsers but not others.
So, a bug in YouTube's compatibility-autodetection caused it to fall back to a slower, bitrate-limited fallback method that it didn't need to, for some versions of Firefox. They took two weeks to deploy the fix. Considering those two weeks included Christmas and the bug didn't affect security or render the site unavailable, this seems like a pretty good response time.
- chei0aiV 11y agoBrowsers should start submitting a random 10 character string for the User-Agent header.
- toomuchtodo 11y agoCould this be done with an extension?
- chei0aiV 11y agoWith an extension to this extension, yes: http://chrispederick.com/work/user-agent-switcher/ http://chrispederick.com/work/user-agent-switcher/
- gizmo686 11y agoYes. https://github.com/muzuiget/user_agent_overrider https://github.com/muzuiget/user_agent_overrider As far as I am aware, no extension currently offers the option of a random user agent, but many (including the one linked) allows user supplied use agents, and there is no reason you could not make one support random user agents.
- Survey_Sez 11y agoThere is in fact already an extension which will randomly change the browser user agent. https://github.com/dillbyrne/random-agent-spoofer https://github.com/dillbyrne/random-agent-spoofer
- danieldk 11y agoAlso, uMatrix can randomly switch user agent strings (among many other things).
- darkmighty 11y agoWouldn't that result in even-uglier hacks for finding user agent becoming standard?
- cornstalks 11y agoThat would break more than it would fix. Video is hard (not all devices or browsers support the same codecs, bitrates, frame rates, etc), and YouTube has to use the User Agent to try to serve videos that the client can actually play. A random User Agent would mean that all those browsers that need a special video format wouldn't get the type of video they need, which sounds like a crappy world to live in (compared to the crappy world we already live in with meaningful User Agents).
- kuschku 11y ago> (compared to the crappy world we already live in with meaningful User Agents). > Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36 Google Chrome tells us it is: a Mozilla, it is AppleWebkit, it is KHTML, it is Gecko, it is Safari, and it is Chrome. "Meaningful" is something different.
- geofft 11y agoIt's meaningful. It communicates exactly what the browser is to anyone who is capable of receiving the intended communication. (It also communicates other things to people who are not, but "Google Chrome 41.0.2228.0" would be absolutely meaningless to these listeners, so that doesn't seem like an objection with merit.) You might object to the form of the communication, but that doesn't render the communication inexact. Just think of it as browser slang.
- pdkl95 11y ago> It communicates exactly what the browser is This is true, which is not particularly useful when deciding if a feature is available. Using the user agent to make this decision incorrectly assumes that all user agents of a particular browser+version all support exactly the same set of features. This is obviously not true. The user agent may be meaningful[1], but the meaning that it communicates isn't feature data. [1] If you take the header at it's word; as the bug being discussed demonstrates, user ages may be lying.
- amalcon 11y agoIf this is your goal, wouldn't it make more sense to just stop sending the User-Agent header?
- g1n016399 11y agoVarious websites break if you don't send the User-Agent header. So, in the short term, no, in the long term, yes.
- lmm 11y agoAre there really a substantial number of sites that break if you don't send the header but work if you send a random 10-character string?
- x0 11y agoMany sites behind Cloudflare. If I don't have this line in my .wgetrc, I get 403's sometimes from sites using Cloudflare. user_agent=Mozilla/5.0 (compatible; CloudFlare-AlwaysOnline/1.0; +https://www.cloudflare.com/always-online https://www.cloudflare.com/always-online)
- x0 11y agoNote: the specific user-agent doesn't matter, I just think it's funny to steal Cloudflare's one.
- kuschku 11y agoI do the same whenever a site requests personal info from me and I don't want to give it. Find the corresponding info from the company or their CEO, use that. And whenever some site wants me to register for a newsletter, I enter their own "critical support" mail address. I hope at some point these sites learn that mandatory anything just hives you useless data.
- 11y ago
- cinquemb 11y agoOr cycle through all those lists of the top n used, and put some conditionals in /mozilla-central/netwerk/protocol/http/nsHttpHandler.cpp to avoid all those breaking effects (to some degree). Added benefit of getting alot of "not recognized computers" or whatever emails from google lol
- ketralnis 11y agoBecause the days of browsers having bugs that need workarounds are over?
- lazyjones 11y agoHopefully the days of websites having (or being able) to work around all browser bugs of the past 20 years are over.
- junto 11y agoWhy send one at all?
- plorkyeran 11y agoOnly serving 360p basically does render the site unusable.
- orliesaurus 11y agoHow so?
- plorkyeran 11y agoA video site that doesn't serve watchable video isn't much of a video site. My reaction to getting 360p (or 240p...) video from Youtube is to close the tab.
- Buge 11y agoYoutube used to be only 240p, and I found it perfectly watchable. Then when 360p started to roll out, people played all kinds of weird url tricks to try to force videos to be high quality (360p). Tons of videos from then are only available in those resolutions, and I don't think it's productive to close the tab any time you encounter a video from 2007 or 2008.
- swang 11y agoI mean sure if you're stuck in 2007 it's fine. The average screen resolution in 2007 was 1024x768. Most of us now have ~1080p-ish type screens or on mobile where it's even higher. We also now have the bandwidth to watch 720p/1080p videos whereas in 2007 that was less true to a broader audience. 360p is pretty unwatchable for me on my screen from 2011/2012, let alone anything that's been released in the past 2 years.
- babuskov 11y agoIt really depends on your usage patterns. I watch YT mostly for audio in the videos. Either it's music or some documentary or interviews or shows like This Week in Startups. Video is really not important and I don't want to waste my bandwidth on it. I watch all videos at 360p by default and only increase it manually when I really need to see the detail. I also know a lot of people who just start a playlist with music and leave YT in the background the whole day. They don't even have that tab active in the browser.
- yeukhon 11y ago> Browsers identify themselves with a user-agent string, and the user agent strings are a giant disaster of technical debt resulting from a long history of browsers working around buggy websites and websites working around buggy browsers. I really don't get why we can't just have a "fuck it" mentality for user-agent string. User agent has been the biggest technical shit debt I have ever seen so far on the web. 1. Fuck the existing user-agent string. 2. Simplify to Browser-name: version Anyone depending on existing scheme will find failure and they will update after googling a bit. Sure there are many variations / forks, and those should identify themselves either with the upstream or decide to advertise herself. The only problem is people running old version of browser as those won't get any updates. Sorry for the language, but seriously, fuck the existing user-agent detection. The only reason I find user-agent still useful is simply tracking the % of chrome/firefox/edge/ie/safari/mobile users, and that's all web analytic people care about as far as browser choice is concerned. User-agent is unreliable and should not be trusted.
- fixermark 11y agoIt's a tragedy of the commons. You try to implement that in your browser and launch it, and many websites will break (banks, in particular). Users will download your browser and find that it doesn't work on [FAVORITE SITE X], and they won't blame the site, they'll blame your browser. After all, [FAVORITE SITE X] worked with the browser they used previously to yours; clearly, it's your fault that the site doesn't work now. So we continue to make incremental changes and work around issues with popular sites needing to sniff user agents, while authors of new sites (that someday become popular) continue to work around issues with popular browsers by (ideally) checking the DOM in JavaScript, and (sometimes of necessity because the data of interest isn't available through the DOM for security or design-hole reasons) sniffing the user agent.
- yeukhon 11y agoand this is a never-ending debt. If we take a big stand and give a one-year deprecation like SHA1, we should get through it. Of course, no one would do that because everyone is so dependent on this string.
- 11y ago
- echochar 11y ago"...user agent strings are a giant disaster of technical debt" Amen. I agree with the commenter below who suggests we use random strings instead. Unless there is some sort of published standard for what this header should contain and what each byte means, the contents may as well be random. The "history" of "user-agents" (about 20 years) is not very long, assuming the web is going to last more than 20 years into the future. Taking a long view, we are still in the nascent phase.
- kobayashi 11y agoAre you suggesting unique randomized strings for every user?
- deleted 11y ago[deleted]
- debaserab2 11y agoI'm sorry, but I still find the user agent string to be incredibly useful despite it's many shortcomings. Not so much for deciding what to serve to a request, but moreso to analyze your audience and figure out from a technical perspective what is feasible and what is not. For example, a recent decision I made was to decide whether or not to rewrite a portion of our application in a javascript framework that did not offer IE8 support. I was able to quickly validate what portion of my userbase I was affecting by looking at user agent strings. Request headers are a fantastic way to capture this little bit of information. Using javascript feature checking depends on a javascript engine successfully loading and parsing whatever scripts I've provided to the client. Request headers are simple plaintext that don't fail in even the most bare bones of situations.
- fkooman 11y agohttps://en.wikipedia.org/wiki/Progressive_enhancement https://en.wikipedia.org/wiki/Progressive_enhancement https://en.wikipedia.org/wiki/Fault_tolerance https://en.wikipedia.org/wiki/Fault_tolerance No need to do browser detection. Just make your site work without JS as well :)
- userbinator 11y agoI think the whole situation with user-agent strings being ridiculous was really put into perspective when I read that the latest version of IE (Edge) has a UA like this: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136
- DannyBee 11y ago"They took two weeks to deploy the fix. Considering those two weeks included Christmas and the bug didn't affect security or render the site unavailable, this seems like a pretty good response time." Note that plenty of smart companies have things like production freezes at holiday times :) So this is not entirely surprising.
- pcwalton 11y agoIf bugs can't be fixed during a time frame, then I'd think new features shouldn't be rolled out during that time frame either.
- deleted 11y ago[deleted]
- DannyBee 11y agoThey generally aren't. The freezes are real freezes: New software releases are not rolled out during that time period, be they new features of bugs. (they are always exceptions in any of the companies i've been in, but that's been the rule)
- deleted 11y ago[deleted]
- zobzu 11y ago1) break everything 2) change freeze 3) ??? Profit
- skarap 11y agoGuess everybody has read this multiple times, but it's highly on-topic: http://webaim.org/blog/user-agent-string-history/ http://webaim.org/blog/user-agent-string-history/
- josteink 11y ago> So, a bug in YouTube's compatibility-autodetection caused it to fall back to a slower, bitrate-limited fallback method that it didn't need to, for some versions of Firefox. They took two weeks to deploy the fix. Considering those two weeks included Christmas and the bug didn't affect security or render the site unavailable, this seems like a pretty good response time. Do you think it would take 2 weeks or less than a hour if the browser affected was Google Chrome? Google has systematically made Firefox an inferior option when using Youtube, pushing people to install Chrome instead because "Firefox doesn't work". At some point you almost start thinking they're doing it intentionally and maliciously to push their own (closed, DRMed) browser.
- skarap 11y agoIt's not just them. Have you tried viewing HN comments in Firefox for Android? A few years ago Chrome gained majority among web developers and everyone just stopped testing with Firefox or any other browser. In fact not just testing - they started developing for Chrome only. And now we've got us into another IE6 situation and I think it will be even harder to overcome this time.
- berdario 11y agoThis is the crux of the issue. Gmail itself is unusable on Android + Firefox. When using an alternative browser you'll also stumble in problems with plenty of Android apps: Slack, Citymapper, etc... (when opening a web page intent, they expect that the only app that'll receive that will be Chrome) The situation isn't as bad for desktop browsers, but it's depressing how things can still be broken.
- skarap 11y ago> The situation isn't as bad for desktop browsers Don't worry, it will get worse. Firefox is now forced to accept `-webkit-` in css (http://www.theregister.co.uk/2016/01/04/firefox_webkit_css_support/ http://www.theregister.co.uk/2016/01/04/firefox_webkit_css_s...) not to be "broken". This will obviously lead to even less Firefox testing. Hell, even I (my team) am contributing to this! We're working on Angular-based web SPA now. It hasn't got much functionality yet, but already has quite a few bugs when viewed in Firefox. And the usual answer from frontend guys is "It's a firefox bug!".
- akerro 11y ago>a bug in YouTube's compatibility-autodetection caused it to fall back to a slower I double it's a bug, it's not the first time it happened, when YT introduced full HTML5 mode, there was a bug that for firefox, and only for firefox youtube was serving video with incompatible codec, the same as for Chrome, but Ff didn't have that codec implemented yet, so video didn't work. Opera was served video same as before, I noticed on reddit and other forums people were complaining on Firefox, that it stopped working on youtube. People started posting "I'm moving to chrome because it works". I think it's a plan to annoy firefox users by serving them not compatible videos so people move to Chrome. Google IS internet.
- thawkins 11y agoNever attribute to malevalence what can be explained by incompetance.
- digi_owl 11y agoIn principle, yes. But when it keeps happening again and again and again, it takes on the appearance of premeditation.
- noja 11y agoNever say never.
- akerro 11y agoSo, you're saying that Google doesn't test stuff they push on production?
- Uther 11y agoIn this case the bug was only for a small subset of the Firefox users (Firefox without x264 support). It doesn't seems impossible to me they missed this specific case.
- Twisell 11y agoActually for me since about two week the full screen mode in html5 with Safari is quite buggy too. So yeah maybe on this specific realease during holyday season they might have test a little more on different platforms and/or delay this patch.
- rubberstamp 11y agoThis is why we need standards and standards compliant web browsers. Then we wouldn't need to worry about testing on all different browsers. As for the case with google products, particularly youtube, those users other than ones using chrome have a really mediocre experience. Try viewing a youtube video on chrome. you won't experience a problem if you quickly try to seek backwards. Now try doing the same in firefox. This is one of the reasons I stick with firefox, which supports open standards and privacy.
- amelius 11y agoYou have good points. But a big company like Google not running automated tests on all major browsers also seems a bit implausible.
- kuschku 11y agoGoogle always only cares about themselves, in this case, Chrome.
- deleted 11y ago[deleted]