oalders/http-browserdetect

Relationship between tablet() and mobile() is confusing

oschwald opened this issue · 6 comments

Currently, the test for mobile appears to explicitly include some tablets, but it does not include everything in tablet(). The documentations for mobile() says, "Returns true if the browser appears to belong to a handheld device." From this, it is not clear if tablet() is supposed to be a subset of mobile() or if they two are supposed to be (mostly) mutually exclusive.

This is related to #38.

I think that tablet() should be a subset of mobile() except in the case of Android. Do we also want to add other devices to mobile such as PlayStation Portable? Those devices are certainly mobile.

@dougwilson thoughts?

Right. It really comes down to do we think "mobile" means you can move the device (so would laptops count?) or if it connects to a cellular network. I think it's currently the later case, which is probably why they are not a strict superset.

I think the crux of the matter is discussed in the article attached to #38:

http://googlewebmastercentral.blogspot.co.uk/2011/03/mo-better-to-also-detect-mobile-user.html

"tablet users usually prefer the full desktop version over the mobile equivalent. If your site matches 'android' and then automatically redirects users, you may be forcing Android tablet users into a sub-optimal experience."

FWIW, my preferred working definition of the "mobile" test would be, "is this a device where the mobile version of a web site is appropriate to present instead of the desktop version"?

I believe this has been resolved; as of v3.0 "tablet" and "mobile" are mutually exclusive. Tablets have tablet() true and mobile() false, and only devices that probably want the mobile version of your web site (phones, handheld game systems, etc.) have mobile() true.