Re:Version 100 in Chrome and Firefox
by adamrezich on Tuesday February 15, 2022 @01:59PM
(#30351043)
I haven't parsed a user agent in about 15 years—what is the actual use case for doing so these days? it seems like it's only become less and less valuable of a thing to do over time.
[ Parent
| on HN ]
here's my two use-cases: working around browser bugs, figuring out if it's a mobile device (e.g. to hide drag-and-drop features for file uploads)
prominent example for a browser bug: https://catchjs.com/Blog/SameSiteCookies
I have to reduce size/resolution of my canvas for iPad as mobile safari gets really slow with html canvases around 10k x 10k size. It's tricky because mobile safari has exactly the same UA as normal safari.
doesn't it have ipad/iphone in the UA string?
It did at some point but people were nerfing it so Apple got angry and ditched it
well, that sucks
Re:Version 100 in Chrome and Firefox
by matyasrichter on Tuesday February 15, 2022 @05:13PM
(#30353562)
If you want to show the user a list of active sessions (and let them revoke one), it makes sense to try and parse the UA and show them a more readable device name.
Me neither. But some do, especially if they 100% need features working that are half-supported/different for different browsers.
Though, I don't find many examples of it and checking individual features for determining whether an API is available for example (doesn't apply to everything, yes I know) right, non-hacky way to go.