browscap-java
browscap-java copied to clipboard
Older iPad not detected as tablet
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.)
Ok thanks for confirming with browscap. We'll check this issue when we find the time to do so.
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.