Hacker News new | ask | show | jobs
by werkjohann 2191 days ago
Feature detection (once called “object detection”) has been considered best practice over user agent sniffing for at least 15 years now: https://web.archive.org/web/20040331111240/https://developer...
1 comments

Both is a better option; sending polyfills for every browser feature you'd want to use is easily hundreds of kilobytes. We use user agents to identify a feature set, but we send feature detection down alongside the polyfills. Detecting features in the client side and sending a second network request to load polyfills for that features adds pretty significant round-trip time.