yuntaozhu / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

userAgent.MOBILE is false for Android 3 tablets #446

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Write an application that outputs the value of goog.userAgent.MOBILE 
2. Compile and run in the Android 3 browser

What is the expected output? What do you see instead?
The output should be true, but it is in fact false

What version of the product are you using? On what operating system?
Current head, Android 3

Please provide any additional information below.
The problem is in the following statement in useragent.js:

    goog.userAgent.detectedMobile_ = goog.userAgent.detectedWebkit_ &&
        ua.indexOf('Mobile') != -1;

The Android 3 browser doesn't contain "Mobile", but it does contain "Android". 
So a check for "Android" should probably be added.

Original issue reported on code.google.com by haeberl...@google.com on 30 Mar 2012 at 9:59

GoogleCodeExporter commented 8 years ago
I wonder whether tablet should fall under the same bucket as mobile though. 
Maybe we need a separate bucket for TABLET? That said, that bucket is very hard 
to fill. Android doesn't seem to have a set user agent for Android tablet. I 
believe it's recommended that Android tablet uses "Android", but some of 
earlier tablet still uses "Android Mobile". Maybe we don't care though and just 
put "Android Mobile" UA to MOBILE as it is today.

Thoughts?

Original comment by chrishe...@google.com on 30 Mar 2012 at 10:03

GoogleCodeExporter commented 8 years ago
Good points. It probably all depends on the way the value is used.

To give you some background: We are using this value to determine whether we 
should activate touch navigation or mouse navigation. But maybe we shouldn't 
rely on the fact that something is "MOBILE" to have a touchscreen and make sure 
to check for that feature explicitly.

Original comment by haeberl...@google.com on 30 Mar 2012 at 10:10

GoogleCodeExporter commented 8 years ago
I think we ought to differentiate between tablet and mobile.  We could also 
have TOUCH (which would be a superset of both).

Original comment by nn...@google.com on 11 May 2012 at 12:53