summaryrefslogtreecommitdiffstats
path: root/shared/src
diff options
context:
space:
mode:
authorAdam Wagner <wbadam@users.noreply.github.com>2018-01-10 11:40:42 +0200
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-01-10 11:40:42 +0200
commit99035ecfbf33603ddbbe445b8980c67b96e8b0b1 (patch)
tree4ab6d53561a2d96634618c88acefa4bdf22f9154 /shared/src
parent44d4eab3535e89410e4fe4aa54c1912f701769ff (diff)
downloadvaadin-framework-99035ecfbf33603ddbbe445b8980c67b96e8b0b1.tar.gz
vaadin-framework-99035ecfbf33603ddbbe445b8980c67b96e8b0b1.zip
Recognise Firefox and its version on iOS (#10466)
Fixes #9592
Diffstat (limited to 'shared/src')
-rw-r--r--shared/src/main/java/com/vaadin/shared/VBrowserDetails.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/VBrowserDetails.java b/shared/src/main/java/com/vaadin/shared/VBrowserDetails.java
index e226751b64..b33e82c1a3 100644
--- a/shared/src/main/java/com/vaadin/shared/VBrowserDetails.java
+++ b/shared/src/main/java/com/vaadin/shared/VBrowserDetails.java
@@ -90,9 +90,10 @@ public class VBrowserDetails implements Serializable {
isIE = isIE || isTrident;
isPhantomJS = userAgent.indexOf("phantomjs/") != -1;
- isSafari = !isChrome && !isIE && !isPhantomJS
+ isFirefox = userAgent.indexOf(" firefox/") != -1
+ || userAgent.indexOf("fxios/") != -1;
+ isSafari = !isChrome && !isIE && !isPhantomJS && !isFirefox
&& userAgent.indexOf("safari") != -1;
- isFirefox = userAgent.indexOf(" firefox/") != -1;
if (userAgent.indexOf(" edge/") != -1) {
isEdge = true;
isChrome = false;
@@ -163,7 +164,12 @@ public class VBrowserDetails implements Serializable {
parseVersionString(ieVersionString);
}
} else if (isFirefox) {
- int i = userAgent.indexOf(" firefox/") + 9;
+ int i = userAgent.indexOf(" firefox/");
+ if (i != -1) {
+ i += " firefox/".length();
+ } else {
+ i = userAgent.indexOf(" fxios/") + " fxios/".length();
+ }
parseVersionString(safeSubstring(userAgent, i, i + 5));
} else if (isChrome) {
int i = userAgent.indexOf(" chrome/");