DEV Community

Discussion on: All You Need to Know About Browser's User Agent String

Collapse
 
dealloc profile image
Wannes Gennar

As a rule of thumb, you shouldn't try to detect browsers.
Instead, try detecting the features that you require for your software to be able to run (like Modernizr and family do).
In the history of the user agent (which I admit was a very interesting read), you outline how developers using the user agent string for feature toggles created that problem in the first place.

On top of that, I recall reading that Google is going to try and "deprecate" the user agent string by making it something generic, and not give away the users platform etc

Collapse
 
saadnoorsalehin profile image
saadnoor salehin

yes, I agree, but still there are some use cases for browser specific features. Eg: You want to show a toast to your users if user uses browsers you don't support officially.