5 ms·
User agent for Edge-Chromium is a bit of a mess. Usually it identifies as "Edg", sometimes as Chrome, and sometimes as Edge (the old one). Specifically, that o
by wlesieutre 7y ago
User agent for Edge-Chromium is a bit of a mess. Usually it identifies as "Edg", sometimes as Chrome, and sometimes as Edge (the old one).
Specifically, that old Edge agent comes up for streaming sites because old Edge has different DRM systems and was able to serve 4K streams from Netflix and others, which Chrome did not do. New Edge still has those capabilities, so it doesn't want to be served the Chrome compatible version.
I wonder if YouTube somehow ended triggering legacy Edge user agent on account of being a video site?
- judge2020 7y agoThis is probably it, the user agent detection library likely got updated to include the new Edge chromium build as "Edge browser" and so YT doesn't know the difference between Chromium-based and Trident-based edge. For reference: Automatic user-agent in Edge (Trident engine): Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18362 Automatic user-agent in the Chromium version: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3739.0 Safari/537.36 Edg/75.0.109.0
- jve 7y agoTechnical correction. Edge had its own engine: Spartan > The Spartan rendering engine (edgehtml.dll) is a new component and separate from Trident (mshtml.dll). The new engine began as a fork of Trident, but has since diverged rapidly over the past many months, similar to how several other browser engines have started as forks prior to diverging. The new rendering engine is also being built with a very different set of principles than Trident - for example: a focus on interoperability and the removal of document modes. https://www.neowin.net/news/whats-powering-spartan-internet-explorer-of-course https://www.neowin.net/news/whats-powering-spartan-internet-...
- inlined 7y agoThank god they forked it. Parts of Trident were older than unit testing was a best practice. The cultural best thing to do was wall off those parts and never touch them because regressions would be impossible to find. I once did a bug fix for an assertion in the Trident. It’s still one of the hardest bugs I’ve ever solved. It was hundreds of stack frames deep in recursion (DOM layout code) in a function that was several pages long and had bidirectional goto statements. If I didn’t have the amazing features of Windbg it would have been impossible to solve. In the end it was a variant of the C++ slicing problem (if you store a subclass in an array of superclass you’ll chop off the member variables of the subclass).
- inlined 7y agoDouble checked and the windbg feature I alluded to is now publicly available. Time travel debugging allowed me to pop the assert and then reverse the program state to eventually find when things started to go wrong. If you’re a windows developer and haven’t yet tried out this feature I strongly recommend it.
- emilecantin 7y agoOh man, what a mess! The UA string mentions almost every browser except the one it actually is... I understand the reasons, but I think it might be time for a big "reset", and for browsers to stop lying about who they are.
- wlesieutre 7y agoIt does mention it at the very end. Either "Edge/18.18362" or "Edg/75.0.109.0" But yes, user agents are terrible.
- Analemma_ 7y ago> but I think it might be time for a big "reset", and for browsers to stop lying about who they are The problem is, you can't do this unless every website also "resets" at the same time, because the bad UA detection code will still be out there. The vendors aren't any happier with this situation than we are, but they do it because they have no choice.
- emilecantin 7y agoWho still does user-agent sniffing? I can't remember the last time I saw UA-detection code. Feature-detection and polyfills have been a thing for more than a decade at this point. EDIT: Just for kicks, I'll try it. I just downloaded a User-Agent extension, and I'll set my UA to "Chrome 74", and see if anything breaks.
- jefftk 7y agoI was working on a product that did user-agent sniffing to figure out which image formats were supported (when to serve WebP). A feature-detection based approach is substantially slower because it breaks the preload scanner: https://www.jefftk.com/p/why-parse-the-user-agent https://www.jefftk.com/p/why-parse-the-user-agent
- Dylan16807 7y agoThat was true in 2014! But since 2015 we've had the <picture> element to pick different versions of an image based on screen or capability.
- wlesieutre 7y agoI was actually suggesting it could be on Microsoft's side, sending the old "Edge" UA instead of the new "Edg" one. But it could easily be a screwup in Google's UA detection treating the new version the same as the old one. Big question for my idea is whether Edge's "use old UA for streaming sites" is a hardcoded list of a few sites like Netflix, or if it's something that might have flagged YouTube as being a video site that should get Old Edge agent by mistake. EDIT - MS's useragent overrides are hardcoded to specific domains, so it wouldn't be identifying as Old Edge for YouTube unless someone at Microsoft manually set it to do that. Probably Google's fault for miscategorizing the new UA. >One section of the JSON configuration file is called EdgeDomainActions and is a series of rules that specify what browser Microsoft Edge should impersonate when visiting a particular site. You can see the EdgeDomainActions config section below. https://www.bleepingcomputer.com/news/microsoft/the-new-microsoft-edge-sometimes-impersonates-other-browsers/ https://www.bleepingcomputer.com/news/microsoft/the-new-micr...
- ploxiln 7y agoSurely this is the nail in the user-agent-sniffing coffin
- jsjohnst 7y agoWishful dreaming. Bad habits never die.
- NullPrefix 7y agoAren't Mozilla and Chrome registered trademarks? Can you just go around pretending to be Chrome or Mozilla and not face any consequences??
- willk 7y ago> Mozilla/5.0 is the general token that says the browser is Mozilla compatible, and is common to almost every browser today. [0] [0]https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent#Firefox_UA_string https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Us...
- NullPrefix 7y agoMy question was not about how they are used. My question was about trademarks. You have to defend them or you end up losing them.
- JohnNorman 7y agoThey've lost them since the very beginning. Mozilla's agent initially included Netscape and Chrome's still says Mozilla.
- bzbarsky 7y agoExcept per https://news.ycombinator.com/item?id=20033057 https://news.ycombinator.com/item?id=20033057 going to the pagee with the "Trident-based edge" UA string gives the "modern YouTube" experience. Doing the same with the "Chromium-based Edge" UA string does not.