How best to implement browser feature detection?
I have a set of features, some css and some web api that have spotty support on safari, edge, and ie.
Is there a standard way of targeting per browser environments or wrap unsupported features in a conditional?
All i've seen is hacky css media queries hooking into a particular unsupported css feature to estimate the browser version...
Is there something more foolproof or standard?
I just came across this https://www.npmjs.com/package/caniuse-db figured it might be related here?
Like ideally something on the server with the user agent so I dont have to ship unused stuff... that would be slick.
npm
caniuse-db
Raw browser/feature support data from caniuse.com. Latest version: 1.0.30001439, last published: 6 days ago. Start using caniuse-db in your project by running
npm i caniuse-db
. There are 95 other projects in the npm registry using caniuse-db.0 Replies