arielsalminen / feature.js

Feature.js is a fast, simple and lightweight browser feature detection library in 1kb.
https://featurejs.com/
3.17k stars 115 forks source link

Use of util.old contradicts the point of feature detection #50

Open mynamesleon opened 8 years ago

mynamesleon commented 8 years ago

Feature detection largely came about because checking for browser versions via the user agent string is unreliable. This is for multiple reasons including (as I'm sure you're already aware):

  1. false positives (e.g. Opera and Edge include "chrome" in their user agent string)
  2. Spoofing
  3. Assuming that a certain User Agent is a reliable means of testing things (e.g. some browsers such as UC Browser and Dolphin Browser were available on very old versions of Android, but supported features the default Android browser of the time did not. So checking for that Android version would have been unreliable)

So including it as part of some of your checks seems somewhat contradictory.

meowsus commented 5 years ago

@mynamesleon that's a good point. I'd be in favor of removing this test, since it is unreliable, but it would require a major version change, due to it's breaking nature.

I'm curious of @viljamis's thoughts on this one.