The user agent string becomes meaningless and extremely unreliable.
You should not use the user agent string, use the discovery function instead. If you need to use function X, check if there is X.
But to answer your question directly, there is no alternative to JS.
source share