7 ms·
Please, not another hack of the user-agent string. If sites break, let them break.
by silvestrov 5y ago
Please, not another hack of the user-agent string.
If sites break, let them break.
- peakaboo 5y agoCompletely agree.
- daveslash 5y agoYes. Agreed. Sites should be doing their best to avoid having to check the UA String. 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...)
- dgb23 5y agoThe picture element let’s you do that very conveniently w/o checking the UA. It’s a bit like a switch statement.
- silvestrov 5y ago> tightly-controlled environments (medical, aerospace, ...) 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.
- lcnmrn 5y agoJump from 99 to 109 then let them break. Internal sites of universities and corporations need to work until they get fixed.
- Hamuko 5y agoIf those internal sites are so crucial, then maybe they shouldn't build them like a house of cards.
- sangnoir 5y ago> If those internal sites are so crucial, then maybe they shouldn't build them like a house of cards 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?"
- GoblinSlayer 5y agoOne check code was 1 * this.versionData.substring(0, 2) < 23, so it would need to jump to something like version 9900 or 99000.
- tpmx 5y agoIf sites break, let them break. 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.
- coldpie 5y agoYes. Your software doesn't exist in isolation; you have users. Your #1 goal is not to make your software ideologically perfect. Your #1 goal is to make your software useful to its users. Sometimes you have to break things, yes, but these events should be strongly justified and impossible in practice to avoid. Bumping a version number in a user-agent string doesn't rise to that level.
- Beltalowda 5y agoSome people relying on fixed width digits will happen anyway, no matter how you send the version. There's decades of experience with this. It has nothing to do with the User-Agent header as such. 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.
- coldpie 5y ago> With the Chrome "backup plan" literally everyone will have to modify their code to make it work 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.
- yifanl 5y agoWhy is there version numbers for web browsers at all when version bumps are forced? To the average user, it's not a meaningful number at all. Breaking sites as a side effect for bumping a version number that can't not be bumped is a totally insane thing to me.