hgoebl / mobile-detect.js

Device detection (phone, tablet, desktop, mobile grade, os, versions)
http://hgoebl.github.io/mobile-detect.js/
MIT License
4.12k stars 892 forks source link

Would this add browser detecting feature? #63

Closed weilinzung closed 7 years ago

weilinzung commented 7 years ago

Would this add browser detecting feature? If people use this JS, I think it is because some devices version may not support something, like ES6. If in this case, I think it is good to also have browser detecting feature.

Thanks, Wei

hgoebl commented 7 years ago

Could you please describe in detail what exactly miss in this library and what you would expect?

weilinzung commented 7 years ago

For example, right now i have a project is using ECMAScript 6, so not all of the browser versions are supported, specially browsers are not the latest version on mobile(IOS, Android).

I use this library to disable the ES6 script on all which are not desktop. And on the IE8-11, it is not support ES6, so I am thinking if this library could has the additional conditional logic could detect devices and browser versions which would be help a lot.

ES6 is becoming popular, I think a lot of developer would use it soon. If there are more this scripts and plugins are rolled out, but would give a lot of issues for people who doesn't have latest browser version. (any websites should be able to support at least the two or three latest versions)

Here is the list of ES6 compatibility table: https://kangax.github.io/compat-table/es6/ It is a lot of opportunity if this library to has browser versions support because it could let developer to write much easier logic.

thanks for you time!

hgoebl commented 7 years ago

Definitely, mobile-detect.js is not a solution for this.

1) use https://babeljs.io/ to transpile your ES6 to legacy browsers 2) use https://modernizr.com/ to detect features in your browser

Believe me, mobile-detect is the wrong way to achieve what you want.