News for hackers. Stuff that matters.
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.
Re:Version 100 in Chrome and Firefox by asddubs on Tuesday February 15, 2022 @02:14PM (#30351252)
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

Re:Version 100 in Chrome and Firefox by yread on Tuesday February 15, 2022 @03:57PM (#30352611)
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.
Re:Version 100 in Chrome and Firefox by asddubs on Tuesday February 15, 2022 @04:15PM (#30352821)
doesn't it have ipad/iphone in the UA string?
Re:Version 100 in Chrome and Firefox by yread on Tuesday February 15, 2022 @04:35PM (#30353090)
It did at some point but people were nerfing it so Apple got angry and ditched it
Re:Version 100 in Chrome and Firefox by asddubs on Tuesday February 15, 2022 @04:49PM (#30353250)
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.
Re:Version 100 in Chrome and Firefox by can16358p on Tuesday February 15, 2022 @02:07PM (#30351156)
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.

Re:Version 100 in Chrome and Firefox by soheilpro on Tuesday February 15, 2022 @07:26PM (#30354864)
One usage is analytics.