flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Handle Chrome and Firefox on iOS
Date Wed, 13 Sep 2017 09:15:52 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop bba2f29e7 -> 5109c4022


Handle Chrome and Firefox on iOS


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/5109c402
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/5109c402
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/5109c402

Branch: refs/heads/develop
Commit: 5109c40228a31d124ac55a3716ae251ef44713ef
Parents: bba2f29
Author: Harbs <harbs@in-tools.com>
Authored: Wed Sep 13 12:15:49 2017 +0300
Committer: Harbs <harbs@in-tools.com>
Committed: Wed Sep 13 12:15:49 2017 +0300

----------------------------------------------------------------------
 .../flex/org/apache/flex/utils/BrowserInfo.as   | 32 ++++++++++++++++----
 1 file changed, 26 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5109c402/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BrowserInfo.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BrowserInfo.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BrowserInfo.as
index 59f4052..7f265f7 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BrowserInfo.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BrowserInfo.as
@@ -124,16 +124,18 @@ var m = str.match(/\brv[ :]+[\d\.]+/g)
         {
             var ua:String = window["navigator"]["userAgent"];
             //Figure out formFactor
-            if(ua.indexOf("Mobile") != -1)
-                _formFactor = "Mobile";
-            else if(ua.indexOf("Tablet") != -1)
-                _formFactor = "Tablet";
-            else if(ua.indexOf("iPad") != -1)
+            if(ua.indexOf("iPad") != -1)
                 _formFactor = "iPad";
             else if(ua.indexOf("iPhone") != -1)
                 _formFactor = "iPhone";
             else if(ua.indexOf("iPod") != -1)
                 _formFactor = "iPod";
+            else if(ua.indexOf("Tablet") != -1)
+                _formFactor = "Tablet";
+            else if(ua.indexOf("Mobile") != -1)
+                _formFactor = "Mobile";
+            else if(ua.indexOf("Android") != -1)
+                _formFactor = "Tablet";
             else if(ua.indexOf("TV;") != -1)
                 _formFactor = "TV";
             else
@@ -209,7 +211,25 @@ var m = str.match(/\brv[ :]+[\d\.]+/g)
                     _engine = "WebKit";
                 else 
                     _engine = "Blink";
-            }            
+            }
+            else if(ua.indexOf("CriOS") != -1)// CriOS is Chrome on mobile devices
+            {
+                _browser = "Chrome";
+                verMatch = ua.match(/CriOS\/[\d\.]+/i);
+                if(verMatch)
+                    _version = _engineVersion = verMatch[0].split("/")[1];
+                
+                 _engine = "WebKit";
+            }
+            else if(ua.indexOf("FxiOS") != -1)// FxiOS is Firefox on mobile devices
+            {
+                _browser = "Firefox";
+                verMatch = ua.match(/FxiOS\/[\d\.]+/i);
+                if(verMatch)
+                    _version = _engineVersion = verMatch[0].split("/")[1];
+                
+                 _engine = "WebKit";
+            }
         }
     }   
 }


Mime
View raw message