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.
prominent example for a browser bug: https://catchjs.com/Blog/SameSiteCookies
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.