Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A lot of tablets flagged as phones #1528

Closed
00niko opened this issue Jun 26, 2017 · 7 comments
Closed

A lot of tablets flagged as phones #1528

00niko opened this issue Jun 26, 2017 · 7 comments

Comments

@00niko
Copy link

00niko commented Jun 26, 2017

By using TDS tracker "bemob" i found this list of tablets:

Mozilla/5.0 (Linux; Android 4.4.2; 9005X Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 YaBrowser/17.1.0.412.01 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; GT-P5200 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; Hit Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.141 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.4; HUAWEI MediaPad T1 10 4G Build/HuaweiMediaPad) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.132 Safari/537.36
Mozilla/5.0 (Linux; U; Android 4.3; ru-ru; K00Z Build/JSS15Q) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
Mozilla/5.0 (Linux; Android 4.4.2; K013 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; K018 Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.132 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; Lenovo TAB 2 A7-30DC Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Safari/537.36
Mozilla/5.0 (Linux; Android 5.0.1; Lenovo TAB 2 A7-30HC Build/LRX21M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.94 Safari/537.36
Mozilla/5.0 (Linux; Android 5.1; Lenovo TAB 2 A8-50LC Build/LMY47D; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Safari/537.36
Mozilla/5.0 (Linux; Android 5.1.1; Lenovo YT3-850M Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; LenovoA3300-HV Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Safari/537.36
Mozilla/5.0 (Linux; Android 6.0; Light_AT200 Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/54.0.2840.85 Safari/537.36 YandexSearch/5.45/apad
Mozilla/5.0 (Linux; U; Android 4.3; ru-ru; MediaPad T1 8.0 Build/HuaweiMediaPad) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
Mozilla/5.0 (Linux; Android 4.2.2; MID Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Mozilla/5.0 (Linux; Android 5.1; Optima 7202 3G TS7055MG Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.89 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; Optima E7.1 3G TT7071MG Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 YaBrowser/15.4.2272.3842.01 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; Oysters T72M 3G Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36
Mozilla/5.0 (Linux; Android 6.0.1; P01T_1 Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.132 Safari/537.36
Mozilla/5.0 (Linux; Android 5.0.2; P021 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Safari/537.36
Mozilla/5.0 (Linux; Android 5.1; P80h(D4C5) Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 YaBrowser/17.1.2.339.01 Safari/537.36
Mozilla/5.0 (Linux; Android 5.1; Plane 7501M 3G PS7022MG Build/LMY47I; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Safari/537.36 YandexSearch/6.30/apad
Mozilla/5.0 (Linux; Android 6.0; Plane 8713T 3G PS8106PG Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Safari/537.36
Mozilla/5.0 (Linux; Android 5.1; Plane S7.0 3G PS7005MG Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 YaBrowser/15.4.2272.3842.01 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; PMT3047_3G Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.141 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; PMT3057_3G Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.109 Safari/537.36
Mozilla/5.0 (Linux; Android 6.0; PMT3118_3G Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; ru-ru; SAMSUNG SM-T231 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Safari/537.36
Mozilla/5.0 (Linux; Android 5.1.1; SGP321 Build/10.7.A.0.222) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Safari/537.36
Mozilla/5.0 (Linux; U; Android 4.2.2; en-US; SM-T111 Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 UCBrowser/10.10.8.820 U3/0.8.0 Mobile Safari/534.30
Mozilla/5.0 (Linux; Android 4.4.2; SM-T211 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.90 YaBrowser/16.11.0.649.01 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; SM-T231 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.109 Safari/537.36
Mozilla/5.0 (Linux; Android 5.1.1; SM-T331 Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 YaBrowser/17.3.2.414.01 Safari/537.36
Mozilla/5.0 (Linux; Android 5.0.2; SM-T531 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.132 Safari/537.36
Mozilla/5.0 (Linux; Android 5.0.2; SM-T535 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.4; SM-T561 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.132 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; SUPRA M74CG Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; T1-701u Build/HuaweiMediaPad) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.4; T700i_3G Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; T72ER3G Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 YaBrowser/14.10.2062.12160.01 Safari/537.36
Mozilla/5.0 (Linux; Android 5.1; T72HA_3G Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 YaBrowser/15.6.2311.6088.01 Yowser/2.0.2 Safari/537.36
Mozilla/5.0 (Linux; Android 5.1; T72HM3G Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 YaBrowser/17.3.2.414.01 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; T72N_3G Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 YaBrowser/15.6.2311.6088.01 Yowser/2.0.2 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; Tab_2 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 YaBrowser/15.12.2.6773.01 Yowser/2.5.2 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; Tesla Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 YaBrowser/17.3.0.373.01 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; TX22 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 YaBrowser/17.3.2.414.01 Safari/537.36
Mozilla/5.0 (Linux; Android 5.1; TZ709 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 YaBrowser/17.3.2.414.01 Safari/537.36
Mozilla/5.0 (Linux; Android 6.0; TZ857 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.90 YaBrowser/16.11.0.653.01 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; YOGA Tablet 2-830L Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Safari/537.36

Also browcast can't detect phone model. Maybe this is the main problem.

@jaydiablo
Copy link
Contributor

I have a PR for this coming soon, just doing some comparison tests.

@jaydiablo
Copy link
Contributor

I wanted to bring up a change I'm making in response to this issue, and log some of my findings.

As I was adding devices for these UAs, I realized that we can change some browsers to detect a mobile phone vs. a tablet (really it's "not a mobile phone", but in most cases this means it's a tablet) by looking for the presence of the "Mobile" keyword in the UA. In the list of UAs above, only one has the "Mobile" keyword, and it's on the Samsung SM-T111 which is one of those devices that straddle the border between a Phone and a Tablet (Phablet, Fonepad, etc...). http://www.amazon.in/Samsung-Galaxy-Tab-Neo-T111/dp/B00O1R0LES It's also on UC Browser, which I haven't explored yet (and wasn't planning on making this change to, yet).

For Chrome, Google's site explicitly states that tablets won't have the "Mobile" keyword:

If you are parsing user agent strings using regular expressions, the following can be used to check against Chrome on Android phones and tablets:

Phone pattern: 'Android' + 'Chrome/[.0-9]* Mobile'
Tablet pattern: 'Android' + 'Chrome/[.0-9]* (?!Mobile)'

https://developer.chrome.com/multidevice/user-agent

I was curious if this change could be made to Android Browser and Android Webview as well, so I grabbed all of the UAs we've seen for those two browsers this year. I removed any that were browsers that were either mis-detected by Browscap (to be fixed later) or were for browsers that Browscap doesn't detect yet and ran them through my changes, further filtering out only the ones that parsed as "general Tablet". I then ran the remaining UAs through Whichbrowser since it returns the device type pretty reliably and has good device detection. I was mainly curious which ones Whichbrowser is parsing as "mobile" (Mobile Phone) vs. which ones it parses as "tablet". Here are the results for these two browsers:

Browser Tablet Count Total Count Percent Correctly Identified
Android Browser 921 1,005 91%
Android Webview 4,245 5,087 83%

This assumes that Whichbrowser is correctly identifying the "mobile" ones, I haven't taken the time to look at each device. At a quick glance it does seem like a lot of them fall into the "Phablet" category, which might explain why they're lacking the "Mobile" keyword in the UA.

Right now I was only planning to make this change to Android Browser, Android Webview, Chrome, Opera, Puffin, Yandex Browser and the new Yandex Search App that I'm adding (found in the UAs in this ticket). I selected these mainly because they're UAs from this ticket, or UAs I saw being mis-detected in some large UA lists that I pulled and did a comparison on (to dev-master).

Seem reasonable?

Most likely this will reduce issues like this one where Tablets are being detected as Mobile, but it does have a smaller chance of Mobile devices being detected as Tablets until the device is explicitly added to the patterns.

I considered making the "default" device "general Mobile Device (Touch)" instead of "general Tablet", but I'm not sure if that really helps anything.

@mimmi20
Copy link
Member

mimmi20 commented Aug 8, 2017

If this help to reduce issues, we could do this, but I prefer general Tablet. We should use the Mobile Device only for Device which are not Phone nor Tablet, like the iPod (Samsung had a similar Device, but I dont remember the name).

@mimmi20
Copy link
Member

mimmi20 commented Aug 8, 2017

Safari based TV devices have the TV token instead of Mobile, but I dont know if this was adopted to Android TV devices.

@jaydiablo
Copy link
Contributor

I saw some devices that whichbrowser parsed as neither mobile or tablet. They have some other types like "gaming" and "devboard".

Here are some that were parsed as "television":

Mozilla/5.0 (Linux; Android 4.4.2; CX-919 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; NEO-X6 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; NEO-X8H-PLUS Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36
Mozilla/5.0 (Linux; Android 5.1.1; AFTM Build/LVY48F) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/41.99900.2250.0307 Safari/537.36

(no "TV" indicator other than the device name)

Here are some that are parsed as "devboard":

Mozilla/5.0 (Linux; Android 4.4.2; rk3188 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; rk31sdk Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/37.0.0.0 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.3; Generic Android on mt5882 Build/KTU84M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.4; rk312x Build/KTU84Q) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Safari/537.36

From the limited research I've done on these, the identifiers seem to be the name of the CPU and/or SDK that the device uses, which might be good candidates for the "general Mobile Device" device.

One side-effect I am seeing is that the Lite tests fail on UAs that lack the "Mobile" keyword but have a Mobile Phone as the detected device (in the full file), as these are detected as Tablets since the Lite file doesn't have most phone devices. That said, the Standard tests don't fail on these, even though they parse the device in the same way. This is due to the "Device_Type" property being excluded from the Standard tests, but not the Lite tests.

@jaydiablo
Copy link
Contributor

I did the same comparison with Chrome (on Android) and came up with 12,000 out of 12,818 that whichbrowser detected as "tablet" (93%).

I think I may just do it for the browsers I mentioned above, minus Android Webview (it seems less consistent there for whatever reason).

@jaydiablo
Copy link
Contributor

Samsung has some guidelines on the "Mobile" keyword for the Samsung Browser:

http://developer.samsung.com/internet/user-agent-string-format

Mobile devices with small screens (e.g. less than 7") use “Mobile”. Smart TVs use “TV”. For devices supporting Virtual Reality contents, use “VR”. If PC UX is appropriate for the device, this field is empty.

jaydiablo added a commit to jaydiablo/browscap that referenced this issue Aug 10, 2017
…ile" in some browsers

Fixes browscap#1528.

Most of the reasoning for what I’m doing here is discussed in the
issue. I’ll add some inline comments.

I added the UAs from browscap#1528 that had a discernible device identifier as
tests.

I did end up adding the “mobile” keyword to Android Webview, because if
I didn’t, the Android Browser patterns would take priority in some
cases.

I did run these changes against several hundred thousand real world
useragents and confirmed that the only difference in parsing was the
change from mobile phone to tablet for some UAs (browser parsing didn’t
change except for a few cases where Puffin was correctly detected where
it was being mis-detected as Chrome previously).

This also adds Chrome/Chromium version 62, which is in the “Dev
Channel” right now (we’ve seen a few UAs with that version already).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants