improve Atoms.device
Opened this issue · 2 comments
At this moment I'm working in MacOSX with chrome and atoms doesn't detect anything.
Atoms.device
return:
Object {os: undefined, width: 1280, height: 424, screen: "small"}
note also that it detects the browser as small
. wtf.
but is possible to know this information with navigator.appVersion
:
"5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36"
link related: http://stackoverflow.com/a/11219680/1656676
Another thing is that can be useful a function like isMobile()
that return a simple boolean (for example, to use tap or click event)
Try to set a array of regexps for desktop OS and I will accept your pull :)
ER are a little complicated, but we could use a better code than we could write!
https://github.com/madrobby/zepto/blob/master/src/detect.js#files
http://faisalman.github.io/ua-parser-js/
http://matthewhudson.me/projects/device.js/
I feel that the good approach for this would be write a new module for device support in QuoJS and use the Atoms Facade for the device detection. I don't know if jQuery have device detection, but would be a good way to have the minimal implementation in Atoms and delegate in the facade. What do you think?
I feel that the correct