10 ms·
Most likely a user-agent check to ensure compatibility. I don't assume any ill intent. That being said, what does annoy me is that we've known for years that f
by danShumway 7y ago
Most likely a user-agent check to ensure compatibility. I don't assume any ill intent.
That being said, what does annoy me is that we've known for years that feature detection is preferable to user-agent detection, and I would kind of expect one of the biggest web development companies in the world to be following best practices.
This isn't my local pizza shop, Google engineers should know better. Have they already forgotten the dumb "best viewed in IE" banners that magically vanished as soon as the user-agent changed? Heck, even more recently the original version of Edge had to literally start lying to websites about its user-agent just so they would stop serving alternative IE hacks. Yeah it's easier in the short term to do browser-detection and whitelisting for rendering quirks and bugs -- it's just unreliable and error-prone over the long term, and hurts the overall web browser ecosystem.
Google should be setting an example for ordinary developers here, not encouraging hacky shortcuts. If Google isn't going to take the time to think about progressive enhancement from the very start of their experiments, who else is going to?
- maratd 7y ago> user-agent check ... don't assume any ill intent. A user-agent check is ill intent for exactly the reasons you state: > we've known for years that feature detection is preferable to user-agent detection Wasn't Google the company that pushed this in the early days of Chrome?
- mcny 7y ago> Wasn't Google the company that pushed this in the early days of Chrome? The official party line had never changed. From what I know, Google still recommends that we mortals use feature detection.
- Klathmon 7y agoIn my experience, while many people don't like to admit it, useragent detection is still one of the best ways to handle many bugs and edge cases in large applications. Feature detection works well for new features or well documented failures, but it quickly begins to break down in many edge cases. For example, mobile Safari shipped a broken implementation of IndexedDB for a while and detecting that was a big pain, but swapping the known bad versions to use websql or localstorage worked great. Edge (pre chromium) had some really weird bug with the JIT and the javascript `.call` function for a bit, but there was no realistic way that I could detect just that bug, so I fell back to useragent detection. There are tons of bugs that I've found over just the last few years that are due to one bad version, or some specific OS/browser/hardware combo, or are just flakey and hard to trigger with code in the page, therefore they are hard to "feature detect". I have a feeling the amount of those kinds of bugs that you see and their frequency only gets worse when you have monumentally huge amounts of traffic and users as someone like Youtube does, and while I think we should still hold them to a good standard, I can see why they would fallback to UA detection. After all, it's better to have a well working experience for most users (even with a subset of the features) than one which breaks 1% of the time (and every time it breaks, like it or not, the users are going to blame the site not the browser). What we really need (in my opinion anyway) is a way of doing UA detection that is much more scoped to specific versions, and remove the ability for those feature detections to accidentally impact new versions or other browsers (either accidentally or on purpose). Something like setting the browser name/version to a hash of the version number and a secret for each version, and possibly doing the same with other parts of the UA (like hardware/device name and OS name/version). Then people like youtube could block known broken or bad useragents from getting some features to avoid serving code that breaks to those users, and then the onus is on them to update their lists every time a new version comes out. There are obviously ways around it (UA checker as a service?), but it at least makes it harder for lazyness to take over.
- saagarjha 7y agoCould you try the faulty operation and see if it failed?
- Klathmon 7y agoSometimes, but not always... For example, the Edge bug was at [1]. It didn't reproduce when the devtools were open, it only happened if the optimizer tried to optimize it which was non-deterministic, and it would only trigger in some cases in pretty weird spots with a lot of supporting code. Feature detecting that would be a nightmare, but UA detecting it (since I now know the exact versions impacted) is super easy and simple and the fix is extremely small. I don't have that in our codebase any more, but it was a perfect example of a bug which can't easily be feature-detected. [1] https://github.com/microsoft/ChakraCore/issues/1415 https://github.com/microsoft/ChakraCore/issues/1415
- penagwin 7y agoThe problem is you can't reliability detect non-deterministic bugs, so in those cases you essentially have to use the UA to decide if you can use them.
- danShumway 7y agoTo a certain extent I feel your pain and get where you're coming from. The problem is -- A) The user agent isn't always specific enough. I've run into rendering bugs that were specific not just to individual browser versions, but individual browser versions on specific platforms. I've seen bugs fixed and introduced that didn't trigger user agent updates. B) Browsers lie about their user agents. Firefox fingerprint protection normalizes the browser version reported in the user-agent to reduce the amount of information leaked. So yes, agent checks can be useful. I've used user agent checks to reduce CPU-heavy animations on older versions of IE, or target rendering bugs that literally can't be detected any other way. I get it. But when I apply those checks, I'm doing it in the spirit of progressive enhancement -- and recognizing that those checks are error prone and might fail in the future. I never gate an entire application behind a whitelist or blacklist. Bear in mind, all of the stuff you're talking about falls under the category of "I've found a bug in a weird situation and I just want to try and figure out if I'm in that situation." Not, "I've found the X situations where my site works, and it will only work in those situations." Very different approaches to web development.
- sametmax 7y ago> Have they already forgotten the dumb "best viewed in IE" banners that magically vanished as soon as the user-agent changed? They have not. It's just that Google is the top tog now, and doesn't care. While Microsoft is the underdog, and linux is not a cancer and they love open source. And in 20 years this may very well reverse again. The bottom line is to not expect share holders driven multinationals to do what you think is right. They are nor good or bad, just without the need for moral, and only constrain by the market and the law (if enforced).
- JohnNorman 7y agoThat's not true, the market and the low are based on common culture and moral. If stuff like this is seen as immoral, companies that do it will have trouble recruiting, raising capital, maintaining social presence, etc.
- amelius 7y ago> They are nor good or bad, just without the need for moral, and only constrain by the market and the law (if enforced). What do you mean by "if enforced"? That companies should be allowed to explore and exploit weaknesses in the legal system, and that we should think this is acceptable behavior? Translated to humans: a person who constantly tries to find the boundaries of the law is most likely an asshole.
- vokep 7y agoThey aren't making any judgement about the moral quality of the law or enforcing it. Just that the law can't really constrain you if it isn't enforced on you. If you have some way of getting the law enforcer to ignore you than you don't really care what the law is
- jchw 7y agoDisclaimer: I work at Google but not on YouTube, speaking in a personal capacity. Long story short, it doesn’t really work this way. As an example, go to google.com on Internet Explorer 6. No, I’m serious. You will find that it loads just fine and even functions, over plain HTTP. It’s only a small subset of functionality, but it does actually work. You can’t do that with feature detection. YouTube may have crossed the threshold where feature detection should be usable for all of the supported platforms and fallbacks, but feature detection is not a panacea; it does take time to execute feature tests, and it can be difficult to detect certain bugs. Most web developers are definitely not Google, and shouldn't copy what Google is doing without knowing that they need to. It’s generally ill-advised to copy things without understanding them anyways. Not assuming malicious intent makes sense to me; the Edge user agent was already very tricky due to the fact that it has long pretended to be Chromium anyways.
- LocalPCGuy 7y ago> You can’t do that with feature detection. This... is just wrong. If you start from that base feature set that works on all browsers, and then utilize feature detection to progressively enhance the experience, you can definitely do just what this statement says. Its just easier to rely on UA sniffing, but don't spread misinformation that it isn't possible. It is a LOT more work, particularly to ensure that the experience is a good as possible on both ends of the spectrum. It's possible that there is better performance using UA sniffing, as the server can decide what code subset to send. So I don't discount it as a potentially valid solution, but just not as "the only way". Thinking like that is how we end up in situations where "best viewed in ... browser" happens.
- jchw 7y agoNo, when I say you can’t, I really mean you can’t. If you try visiting https://google.com https://google.com in IE6, you get the other part of the problem. It doesn’t work. The cipher suites are too old.
- Klathmon 7y agoBut there are genuinely things that can't be feature detected. A bug that happens 1% of the time due to reasons still unknown, or features or bugs that need something to happen on the user or hardware side to detect. For example, I had an issue once where when using WebRTC on some devices with 3 rear-facing cameras on android it would horizontally flip the "long range focus" camera. There is no way to feature detect that. Hell there wasn't even a way for me to feature detect that I should use the second of the 3 cameras on that device (the first was a fisheye-style wide angle lens, and the 3rd was a middle-ground lens, but the second worked best for our usecase). I've also used UA detection on a browser bug that would cause fetch requests to fail if the user went offline for a split second inbetween requests. There is no way for me to detect that before the bug happens, and once it happened the "failures" looked like it just never came back online. UA detection was the only tool I had to fix that until it was fixed at the browser level.
- sorenjan 7y agoIs Youtube still using Polymer 1.0 with the deprecated shadow DOM v0 that's only supported in Chrome without polyfills [0]? I still use the old version because the new version was annoyingly slow in Firefox last time I checked, and I have no reason to switch to the newer one with lower information density and contrast. [0] https://www.theverge.com/2018/7/25/17611444/how-to-speed-up-youtube-microsoft-edge-safari-firefox https://www.theverge.com/2018/7/25/17611444/how-to-speed-up-...
- konart 7y ago>Is Youtube still using Polymer 1.0 Yes if you are logged in. If you switch to private mode - yt will serve you v3.2 >>Polymer.version >"3.2.0"
- themacguffinman 7y agoI get Polymer version 3.2.0 when I'm logged in. They're probably staging a partial rollout which is why switching to private mode makes a difference.
- mattnewton 7y agoDisclaimer: I work at Google but not on YouTube, also speaking just personally. This isn’t practical at all in a latency sensitive environment. Feature detection works once JavaScript has loaded on the page, which means we either have to serve you a giant bundle of stuff you may not be able to use, or we have to degrade the experience of the latest browsers by detecting features and fetching more HTML/CSS/JavaScript once we know they will be able to handle it. Feature detection absolutely is used for some things, but it’s unreasonable from a latency perspective to serve the bundle of all possible sites and make all these decisions on the client. We aren’t talking about polyfills here- A lot of these features mean we are shipping a totally differently lay out because this webkit uses flex box 2009, or mobile safari 8 has a layout bug, or IE has a quirk around event bubbling in video elements, etc. Feature detection stops being better when a) your supported browser list stretches into the early 2000s around the world and b) you are in a latency sensitive environment where it is unacceptable to degrade performance of the latest browsers. If you aren’t bound by those constraints, or the detection has a cheap fallback so it isn’t meaningfully impacting latency, I agree with feature detection.
- kchoudhu 7y agoIt's Youtube, not high frequency trading.
- clarry 7y agoAnd subjectively, the latency on most google services (except for the search page) is pretty bad. Maybe Firefox Nightly isn't modern enough?
- danShumway 7y agoThe logic is apparently that we can't do progressive enhancement because it would force us to make a second network request, but we can rely on unstandardized APIs that force us to ship polyfills that make our site slow on every other browser that's not Chrome. Every decision, from progressive enhancement to supporting bleeding-edge features comes with tradeoffs. Youtube is still choosing tradeoffs, it's just choosing them based on what will work best in Chrome specifically.
- mtgx 7y agoYou don't? And you think the fact that Microsoft also switched to Chromium now after "working together on this" is also a coincidence? Or just an attempt to snuffle out Mozilla and Safari from the market? After all, a duopoly is better than actual competition.
- OrgNet 7y ago> I don't assume any ill intent. You are being a bit naive.
- stcredzero 7y agoThis isn't my local pizza shop, Google engineers should know better. Have they already forgotten the dumb "best viewed in IE" banners that magically vanished as soon as the user-agent changed? Google engineers are now subject to the same forces that IE engineers faced in the IE 6 days. This also includes competition with other browsers and the desire to keep a leading position, which also includes legitimate concerns over latency and reliability. There's also the difficulty of understanding the end user experience from within a large company. The story isn't simple and one sided. It's the mess of plans hitting reality. it's just unreliable and error-prone over the long term, and hurts the overall web browser ecosystem. Power corrupts because it's hard to see one's own small abuses of power, and these form escalating habits over time. A goal like "Don't be Evil" doesn't fall to a single mustache twirling guy in a black hat and cape. It gets sandblasted by a million little things over time.
- JohnNorman 7y agoYou're quite naive, my friend. I used to work at both Microsoft and Google. A few of the guys that run YouTube now, used to be managers on the Hotmail team. Hotmail used to break in Opera and Firefox every few weeks...
- AaronFriel 7y agoThey're specifically looking for the string "Edg", not "E", not "Ed", not "Edge", they're specifically detecting Microsoft Edge. Try it yourself: Go to https://www.youtube.com/new https://www.youtube.com/new with Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3800.0 Safari/537.36 E/76.0.167.1 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3800.0 Safari/537.36 Ed/76.0.167.1 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3800.0 Safari/537.36 Edg/76.0.167.1 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3800.0 Safari/537.36 Edge/76.0.167.1 There should be no doubt this is malicious. They're specifically targeting Microsoft Edge. Varying the string away from the real Edge string (Edg/76.0.167.1) gives you the proper experience. They're badlisting Microsoft Edge (Edgium/Chromium based Edge), not goodlisting Chrome.
- pandres95 7y agoNot really. Tried myself using Edge and didn't work either. Looks more like a whitelisting of "supported" browsers (such as Safari or Firefox), more than a blacklisting of Edge. https://postimg.cc/GTwV1P79 https://postimg.cc/GTwV1P79 https://postimg.cc/r0F3yFM2 https://postimg.cc/r0F3yFM2 However, it's still suspicious they aren't adding the proper support for Edge Chromium. Also tried using the Brave user-agent. Also failed. https://postimg.cc/V0qTsSpg https://postimg.cc/V0qTsSpg
- AaronFriel 7y agoI suspect you didn't try out the user agent strings. Only one of those 4 is blocked.