From 75fca32bcce196703c9b748c3f634c6b901a6d55 Mon Sep 17 00:00:00 2001 From: Vaadin Bot Date: Tue, 14 Sep 2021 12:13:22 +0300 Subject: [PATCH] fix: make IPhone version above 14.7 browsers allowed for Vaadin (#11821) (#11836) Fixes #11654 Co-authored-by: Denis --- .../main/java/com/vaadin/flow/shared/BrowserDetails.java | 7 +++++++ .../java/com/vaadin/flow/shared/BrowserDetailsTest.java | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/flow-server/src/main/java/com/vaadin/flow/shared/BrowserDetails.java b/flow-server/src/main/java/com/vaadin/flow/shared/BrowserDetails.java index fadd835c8d8..f0f9a44bfe9 100644 --- a/flow-server/src/main/java/com/vaadin/flow/shared/BrowserDetails.java +++ b/flow-server/src/main/java/com/vaadin/flow/shared/BrowserDetails.java @@ -608,6 +608,13 @@ public boolean isTooOldToFunctionProperly() { } // Safari 13+ if (isSafari() && getBrowserMajorVersion() < 13) { + if (getOperatingSystemMajorVersion() > 14) { + return false; + } + if (getOperatingSystemMajorVersion() == 14 + && getOperatingSystemMinorVersion() >= 7) { + return false; + } return true; } // Firefox 43+ for now diff --git a/flow-server/src/test/java/com/vaadin/flow/shared/BrowserDetailsTest.java b/flow-server/src/test/java/com/vaadin/flow/shared/BrowserDetailsTest.java index f3f576375cc..bdb6bdaf0c7 100644 --- a/flow-server/src/test/java/com/vaadin/flow/shared/BrowserDetailsTest.java +++ b/flow-server/src/test/java/com/vaadin/flow/shared/BrowserDetailsTest.java @@ -87,6 +87,8 @@ public class BrowserDetailsTest extends TestCase { 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); @@ -606,6 +608,10 @@ public void testIos11Firefox() { assertEngineVersion(bd, 604.3f); } + public void testIphone14_7IsNotOld() { + assertNotTooOld(GOOGLE_APP_IPHONE_14_7); + } + /* * Helper methods below */