flow icon indicating copy to clipboard operation
flow copied to clipboard

Unsupported browser version in Chrome iPhone responsive mode

Open HawkSK opened this issue 3 years ago • 2 comments
trafficstars

Description of the bug

When using the latest Chrome in responsive layout with iPhone emulation (any of the choices iPhone SE, iPhone XR or iPhone 12 Pro) I get the user agent

Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1

which is resolved by isTooOldToFunctionProperly to true. This result in the error page provided by UnsupportedBrowserHandler with header

I'm sorry, but your browser is not supported

In contrast, while using Edge, the user agent is very similar, but is supported.

Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/104.0.5112.81

Expected behavior

Vaadin app should be usable in Chrome responsive layout with iPhone emulation.

Minimal reproducible example

public class VaadinBrowserDetailsTest {
    private static final String USER_AGENT_RESPONSIVE_EDGE_IPHONE = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/104.0.5112.81";
    private static final String USER_AGENT_RESPONSIVE_CHROME_IPHONE = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1";
    @Test
    public void testEdge() {
        var details = new BrowserDetails(USER_AGENT_RESPONSIVE_EDGE_IPHONE);
        Assertions.assertFalse(details.isTooOldToFunctionProperly()); // passes
    }
    @Test
    public void testChrome() {
        var details = new BrowserDetails(USER_AGENT_RESPONSIVE_CHROME_IPHONE);
        Assertions.assertFalse(details.isTooOldToFunctionProperly()); // fails
    }
}

Versions

  • Vaadin / Flow version: 23.1.1
  • Java version: 17
  • OS version: Windows 10, Windows 11
  • Browser version: -- Chrome Version 104.0.5112.81 (Official Build) (64-bit) -- Microsoft Edge Version 104.0.1293.54 (Official build) (64-bit)

HawkSK avatar Aug 16 '22 14:08 HawkSK

For Edge we check browser version (Edg/104.0.5112.81) to be at least 79, whereas for IPhone we check operating system version (OS 13_2_3 like Mac OS X) to be at least 14.7 when browser version (Version/13.0.3) is less than 14 (see #11654 and #13271) .

mcollovati avatar Aug 18 '22 09:08 mcollovati

Related to #14366

mcollovati avatar Aug 18 '22 11:08 mcollovati