4 ms·
And doing this encourages websites that actually need to detect this platform properly to introduce the next generation of horrible things.
by fluffything 6y ago
And doing this encourages websites that actually need to detect this platform properly to introduce the next generation of horrible things.
- dwaite 6y agoBrowsers will almost certainly begin to phase out user agent strings anyway: https://www.zdnet.com/article/google-to-phase-out-user-agent-strings-in-chrome/ https://www.zdnet.com/article/google-to-phase-out-user-agent... . In the vast majority of use cases, these values should not be used to detect platform features - actual feature detection should be used instead.
- kevin_thibedeau 6y agoThey should just make a gentleman's agreement that the four majors will change it to name and version without any of the cruft. Every broken site will be quickly shamed into fixing their shit.
- DaiPlusPlus 6y ago“Every broken site” will be internal enterprise web-applications that haven’t been touched in 15 years where they’ve also lost the source code.
- kevin_thibedeau 6y agoThey can slap a proxy on the front to change it back to what they need.
- saagarjha 6y agoThat sounds like work. Which costs money.
- fluffything 6y agoThey can just not update their browser - which is essentially doing "no work", and is free.
- grishka 6y agoThe replacement they're going with, "client hints", is weird in its own way. Suppose you render your website server-side, and suppose you use different templates for desktop and mobile. You then have to determine the kind you want before any response is sent, but the new method prevents you from doing that; you have to send a response to ask the browser to send the mobile flag in a subsequent request. You'd have to use ugly workarounds for that. One that comes to mind is to issue a redirect to the requested URL itself, but ask for the additional headers. Not optimal because it adds a round-trip and I'm not sure it'll work at all. User agent strings aren't pretty but they make this kind of detection extremely easy and straightforward. And "actual feature detection" doesn't work with SSR, like, at all.
- alerighi 6y agoA good observation, but why do you need to serve a mobile and a desktop version of your site in the first place? You can with modern HTML and CSS make a website that works perfectly on mobile and desktop, without having to serve a different version for the different platform. It doesn't make sense to make the choice of what to render on the user agent: for example if it says Android, what does it mean? It is probably a smartphone, but it could also be a tablet, a TV, or even a PC! An even more stupid idea is to redirect the user to a different domain if you detect that the user agent is mobile, since it usually work one way and thus if you share on a chat the link to the mobile version of the site and the other one opens it on a desktop there is no easy way to get back to the desktop site (most of the times I have to modify the URL!)
- grishka 6y agoI might be a minority, but I don't like modern adaptive websites. They try really hard to work on both touch and non-touch devices with the same underlying markup, and more often than not end up being terrible on both. You end up with these giant, touch-friendly buttons on desktops. Making all your paddings and layouts and font sizes dynamically adapt to the interaction paradigm is hard and almost no one's doing it. Then there are some interactions that are only possible on desktops — like hovering things to reveal menus or tooltips; these websites rarely make use of the unique properties of the mouse. Or sometimes they do but then you happened to open it on your phone and you have to tap and hold the thing to trigger the hover. And so on. > It is probably a smartphone, but it could also be a tablet, a TV, or even a PC! That's what the "request desktop website" setting is for. > An even more stupid idea is to redirect the user to a different domain if you detect that the user agent is mobile Yes, I wholeheartedly agree with you on this one.
- baggy_trough 6y agoGood thing there won't be any more browser/version specific bugs to work around!
- ryandrake 6y agoIf there is a constant in the universe it's that developers will always be trying to detect X by querying for Y and then have their code break when those assumptions become wrong.