Open wilei opened 10 years ago
I'm having a similar issue with a VMWare install.
Same issue here - UA-String from my test device:
"Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; MATBJS; rv:11.0) like Gecko"
windowsTablet function checks for "touch" in the string to determine "tablet"
I was investigating this just yesterday, and from what I found, the user agent reported for many Windows 8 tablets and touch-enabled laptops are the virtually the same. It may not be possible to accurately differentiate tablets from desktops without having to match device codes (which would suck).
I think checking for the ARM
string might be enough. Because tablets most likely run on Win RT. Link: http://msdn.microsoft.com/en-us/library/ie/hh920767%28v=vs.85%29.aspx
Combined sales of Msft/3rd party Windows tablets show the Pro/Intel versions selling much better than the Surface RT on ARM. Checking for ARM will at least flag the Surface RT as a tablet correctly, but tablets, in the Msft world still "most likely" are Intel.
ATTN: @chrismbeckett @netlovers @swatkins @mchambaud @wilei
From what I can tell, there is no reliable way to distinguish between Windows "Tablet" vs "Touch".
Perhaps a note should be added to the README, and the functions/classes renamed - thoughts?
A note in the README sounds fine, I guess. But at least the ARM versions should be filtered out, so the script would be a bit more correct.
On our use-case (which uses forked version of device.js) reason to seperate ARM devices from other Win8 devices is just because ARM devices are so slow -> we drop some of JS-features from those.
So I prefer note in README and ability to check if device is ARM device.
I found 1 article that suggests doing feature detection for ActiveX since it is only on desktop, but that won't work for all browsers. In the end, for my own fork I am going to add the ARM check, and my final fallback is going to look at screen.width / devicePixelRatio or something to detect resolutions > 1200px. This would work when a tablet is hooked to a higher resolution ext monitor to provide a desktop experience.
I've met some problems with device.js's way to detect Windows Tablets.
Detection is done correctly in some cases, but when user has a Windows laptop, with touchscreen and Win8 (or 8.1) device.js detects user as tablet user. And some cases that detection is wrong, as user should be detected as desktop user, instead of tablet user.
One (maybe the only) way to handle this, for now, is to detect these users by OS architecture. ARM is tablet and Win64, x86 and wow64 are desktops.
Sample UA-string for some Lenovo model: