DEV Community

Discussion on: How to Detect Browser in JavaScript

Collapse
 
moopet profile image
Ben Sinclair

Two points:

First, why do you want to detect the browser? In times past it was a useful thing to know how to do, but these days it's usually irrelevant, and when it is relevant it's usually better to test for what individual features are available rather than the branding of the browser.

Second, there are a lot of user agents besides the ones you mention, and it's very common for the userAgent property to be spoofed.