yuntaozhu / closure-library

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

goog.userAgent.product.ANDROID is false for the default browser of Samsung GALAXY S4 #606

Closed GoogleCodeExporter closed 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.product.ANDROID
2. Compile and run in the default browser of Samsung GALAXY S4

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?
commit 2c9ef57ae20a92c27ba3349f9c1bb956a6f138f3

Please provide any additional information below.
The user agent in the default browser of Samsung GALAXY S4 is the following.

Mozilla/5.0 (Linux; Android 4.2.2; ja-jp; SC-04E Build/JDQ39) 
AppleWebkit/535.19 (KHTML,like Gecko) Version/1.0 Chrome/18.0.1025.308 Mobile 
Safari/535.19

The closure library detected 'Chrome' in the following code of 
goog/useragent/product.js.

  if (ua.indexOf('Firefox') != -1) {
    goog.userAgent.product.detectedFirefox_ = true;
  } else if (ua.indexOf('Camino') != -1) {
    goog.userAgent.product.detectedCamino_ = true;
  } else if (ua.indexOf('iPhone') != -1 || ua.indexOf('iPod') != -1) {
    goog.userAgent.product.detectedIphone_ = true;
  } else if (ua.indexOf('iPad') != -1) {
    goog.userAgent.product.detectedIpad_ = true;
  } else if (ua.indexOf('Chrome') != -1) {
    goog.userAgent.product.detectedChrome_ = true;
  } else if (ua.indexOf('Android') != -1) {
    goog.userAgent.product.detectedAndroid_ = true;
  } else if (ua.indexOf('Safari') != -1) {
    goog.userAgent.product.detectedSafari_ = true;
  }

Original issue reported on code.google.com by miyajan...@gmail.com on 13 Nov 2013 at 5:32

GoogleCodeExporter commented 8 years ago
Does goog.labs.userAgent do the right thing here?

Original comment by mart...@google.com on 13 Nov 2013 at 9:52

GoogleCodeExporter commented 8 years ago
goog.labs.userAgent.browser.isChrome() returns true.
goog.labs.userAgent.browser.isAndroidBrowser() returns false.

This is not expected too.

Original comment by miyajan...@gmail.com on 19 Nov 2013 at 7:42

GoogleCodeExporter commented 8 years ago

Original comment by ksrirangpairoj@gmail.com on 2 Oct 2014 at 9:33

Attachments:

GoogleCodeExporter commented 8 years ago
Marked as not feasible in github issue: 
https://github.com/google/closure-library/issues/27

Original comment by joelt...@google.com on 20 Jul 2015 at 10:42