Browser detection

An ideal way to develop a system is to perform capability testing first. We should get the information if the environment where the system will run is capable of doing things we want to do. But that hardly happens, and at the same time it is not always possible, be it any reason—unforeseen issues, changing requirements, insufficient time, and many more. That's one big reason we need browser detection and perform quick fixes.

User agent sniffing

Browser detection is mostly done by checking user agent string, which is not completely reliable because user agent string can be spoofed. A developer is encouraged to use feature detection over browser detection. You should not rely on browser detection to assume that a feature will be ...

Get Test-Driven JavaScript Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.