arielsalminen / feature.js

Feature.js is a fast, simple and lightweight browser feature detection library in 1kb.

Home Page:https://featurejs.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use of util.old contradicts the point of feature detection

mynamesleon opened this issue · comments

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.

@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.