Hacker News new | ask | show | jobs
by robocat 3380 days ago
> No company should _ever_ use user-agents for feature detection

Wrong.

There are plenty of bugs that cannot be detected using feature detection, especially with events and <input> elements. Sometimes you can find a browser-agnostic workaround, but sometimes the only solution is to sniff the browser.

It is especially necessary if you need to support "obsolete" browsers that your customers still use.

It is important to really try and avoid browser sniffing when "fixing" bugs in current versions of browsers (since your "fix" is likely to break in future versions).

Note, feature detection usually implies that you are using JavaScript.