Skip to content

Commit

Permalink
fix: make IPhone version above 14.7 browsers allowed for Vaadin (#11821)
Browse files Browse the repository at this point in the history
Fixes #11654
  • Loading branch information
Denis committed Sep 14, 2021
1 parent 649ae1f commit 282c602
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,17 @@ public boolean isTooOldToFunctionProperly() {
}
// Safari 9+
if (isSafari() && getBrowserMajorVersion() < 9) {
if (getOperatingSystemMajorVersion() > 14) {
return false;
}
if (getOperatingSystemMajorVersion() == 14
&& getOperatingSystemMinorVersion() >= 7) {
return false;
}
return true;
}
// Only ChromeEdge is supported
if (isEdge() && getBrowserMajorVersion() < 79) {
return true;
}
// Firefox 43+ for now
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.vaadin.flow.shared;

import org.junit.Assert;

import junit.framework.TestCase;
import org.junit.Assert;

public class BrowserDetailsTest extends TestCase {

Expand Down Expand Up @@ -68,6 +67,11 @@ public class BrowserDetailsTest extends TestCase {
private static final String IPHONE_IOS_11_FACEBOOK_BROWSER = "Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E302 [FBAN/MessengerForiOS;FBAV/165.0.0.45.95;FBBV/107115338;FBDV/iPhone10,6;FBMD/iPhone;FBSN/iOS;FBSV/11.3.1;FBSS/3;FBCR/DNA;FBID/phone;FBLC/en_GB;FBOP/5;FBRV/0]";
private static final String IPHONE_IOS_11_FIREFOX = "Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_2 like Mac OS X) AppleWebKit/604.3.5 (KHTML, like Gecko) FxiOS/11.1b10377 Mobile/15B202 Safari/604.3.5";

private static final String EDGE_18 = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; ServiceUI 14) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763";
private static final String EDGE_79 = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36 Edg/79.0.309.71";

private static final String GOOGLE_APP_IPHONE_14_7 = "Mozilla/5.0 (iPhone; CPU iPhone OS 14_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/117.0.321844219 Mobile/15E148 Safari/604.1";

public void testSafari3() {
BrowserDetails bd = new BrowserDetails(SAFARI3_WINDOWS);
assertWebKit(bd);
Expand Down Expand Up @@ -596,6 +600,11 @@ public void testIos11Firefox() {
assertEs6(bd);
}

public void testIphone14_7IsNotOld() {
BrowserDetails bd = new BrowserDetails(GOOGLE_APP_IPHONE_14_7);
Assert.assertFalse(bd.isTooOldToFunctionProperly());
}

/*
* Helper methods below
*/
Expand Down

0 comments on commit 282c602

Please sign in to comment.