browscap-java icon indicating copy to clipboard operation
browscap-java copied to clipboard

Older iPad not detected as tablet

Open Lonzak opened this issue 4 years ago • 2 comments
trafficstars

I migrated our user agent functionality to this library. Nearly all unit tests worked except for this UA:

"Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; de-de) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5";

The user agent is not detected as a tablet but iPad qualifies as one. This user agent or similar are listed here: https://developers.whatismybrowser.com/useragents/explore/operating_platform/ipad/9

Sidenote: I also ran it through browscap.org/ua-lookup and it is correctly detected as a tablet there. So it must be a problem with the java library. (Initially i also opened a bug but closed it since it is working for them.)

Lonzak avatar Dec 07 '20 08:12 Lonzak

Ok thanks for confirming with browscap. We'll check this issue when we find the time to do so.

paulrutter avatar Dec 07 '20 17:12 paulrutter

The library matches a different rule than the online checker, but with the same pattern length:

mozilla/5.0*(*cpu*os* like mac os x*)*applewebkit*(*khtml*like*gecko*)*version/5.0*mobile/*safari/* mozilla/5.0*(ipad*cpu os 4_3* like mac os x*)*applewebkit*(*khtml*like*gecko*)*version/5.0*safari/*

We should review the exact rules for comparing priority of matching rules.

arthurmeijer avatar Dec 10 '20 10:12 arthurmeijer