3 ms·
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
by adamrezich 5y ago
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.
- asddubs 5y agohere'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 https://catchjs.com/Blog/SameSiteCookies
- can16358p 5y agoMe 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.
- yread 5y agoI 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.
- matyasrichter 5y agoIf 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.
- soheilpro 5y agoOne usage is analytics.