Hacker News new | ask | show | jobs
by bshimmin 4241 days ago
So we've spent years shouting out the mantra "test for features, not browsers!" and now Mozilla, of all people, tell us that that was basically a bit impractical, and we should just go back to user-agent sniffing like we did 8-10 years ago?
3 comments

It looks like Mozilla is testing for virtually any web browser that is in use. That seems OK.

And, you can choose to do feature detection if you wish. Here's a quick example:

https://cdn.polyfill.io/v1/polyfill.js?features=Array.protot...

More information about that can be found here: https://cdn.polyfill.io/v1/docs/api

> and now Mozilla, of all people, tell us that that was basically a bit impractical

No. What Mozilla did was explain their reasons for doing so. So at the very least your comment should engage with their stated reasons in some detail. Otherwise it's hard for the rest of us to know whether you've got a valid objection or you just replied without really reading the original article.

Not Mozilla. The polyfill service is made and hosted by the Financial Times. Mozilla just kindly offered us a posting on the Hacks blog.