simpleanalytics / roadmap

File you bugs and feature requests here
24 stars 2 forks source link

Detect iPad correctly based on agent + pixels #516

Open adriaandotcom opened 3 years ago

adriaandotcom commented 3 years ago

iPads show sometimes as desktops instead of tablets. This is because of their user agent. We should check based on user agent + pixels.

See HS

jibsaramnim commented 3 years ago

It's probably when the visitor uses the "request desktop website" option, adding this in case it's helpful for future reference.

Question: Is the pixel information of certain iPad models not similar to a 13" MacBook? I feel like I remember something like that, although I'm not actually sure what the exact resolutions and ppi are, so maybe it's possible to reliably tell if it's one of the iPad generations

adriaandotcom commented 3 years ago

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15

https://stackoverflow.com/a/56923008/747044

It doesn't mention iPad anymore. Doesn't matter what the browser setting is. Just nothing :(

jibsaramnim commented 3 years ago

Oh I see yes, interesting. Seems like the suggested solutions involve looking at the few differences that can be found between Mac and iPad, like multitouch support or the for-now-iOS-only Navigator.standalone.