You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/06/25 13:12:00 UTC

[jira] [Commented] (WICKET-6544) Chrome and Firefox on iOS detected as Safari version -1

    [ https://issues.apache.org/jira/browse/WICKET-6544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16522261#comment-16522261 ] 

ASF GitHub Bot commented on WICKET-6544:
----------------------------------------

Github user nielsbasjes commented on the issue:

    https://github.com/apache/wicket/pull/275
  
    @klopfdreh 
    A few points about the slow startup.
    When you explicitly specify which fields you really need the system will completely 'not load' the rules that have no impact. Especially if you do not need the DeviceBrand/DeviceName the impact will be quite large. You can simply pass something like this .withField("AgentName") .withField("DeviceClass") .withField("AgentVersion") and it will have a big impact on both startup times and run times for a not yet cached parse.
    
    I had a look at your project and with this patch the startup time drops to less than 1.5 seconds.
    
    ```
    diff --git pom.xml pom.xml
    index 00cc8f8..7910bd9 100644
    --- pom.xml
    +++ pom.xml
    @@ -146,7 +146,7 @@
                            <dependency>
                                <groupId>nl.basjes.parse.useragent</groupId>
                                <artifactId>yauaa</artifactId>
    -                           <version>4.2</version>
    +                           <version>4.5</version>
                            </dependency>
                            <dependency>
                                    <groupId>com.google.code.findbugs</groupId>
    diff --git wicket-core/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java wicket-core/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java
    index 5a02a3d..1e488e9 100644
    --- wicket-core/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java
    +++ wicket-core/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java
    @@ -151,6 +151,9 @@ public class WebClientInfo extends ClientInfo
                    {
                            userAgentAnalyzer = UserAgentAnalyzer.newBuilder()
                                    .hideMatcherLoadStats()
    +                               .dropTests()
    +                               .withField("AgentName")
    +                               .withField("AgentVersion")
                                    .withCache(25000)
                                    .build();
                            Application.get().setMetaData(UAA_META_DATA_KEY, userAgentAnalyzer);
    @@ -217,7 +220,7 @@ public class WebClientInfo extends ClientInfo
             */
            protected void setBrowserVersion(nl.basjes.parse.useragent.UserAgent parsedUserAgent)
            {
    -               String value = parsedUserAgent.get("AgentVersion").getValue();
    +               String value = parsedUserAgent.getValue("AgentVersion");
                    if (!"Hacker".equals(value))
                    {
                            properties.setBrowserVersion(value);
    ```



> Chrome and Firefox on iOS detected as Safari version -1
> -------------------------------------------------------
>
>                 Key: WICKET-6544
>                 URL: https://issues.apache.org/jira/browse/WICKET-6544
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 7.9.0
>            Reporter: Sven Ackermann
>            Assignee: Maxim Solodovnik
>            Priority: Major
>
> The UserAgent detection on iOS for browsers other than Safari does not work correctly.
> E.g. Chrome 64 has UserAgent
> ??Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) CriOS/64.0.3282.112 Mobile/15D100 Safari/604.1??
> which is recognized by classes {{UserAgent}} and {{WebClientInfo}} as Safari with no version (-1). The problem is that the UserAgent does not contain "Chrome" as required by {{UserAgent.CHROME}}, but instead "CriOS". So it is recognized as Safari, but since it does not contain "version/", no version is set.
> A similar problem exists for Firefox on iOS where the UserAgent contains "FxiOS" instead of "Firefox":
>  ??Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) FxiOS/10.6b8836 Mobile/15D100 Safari/604.5.6??
> In our application this causes some unwanted redirects to legacy pages because we think it is an old Safari browser with no support for some features our pages need. But of course the Chrome und Firefox versions above support all that.
> see also [https://developer.chrome.com/multidevice/user-agent#chrome_for_ios_user_agent|https://developer.chrome.com/multidevice/user-agent#chrome_for_ios_user_agent,] and [https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox#Firefox_for_iOS] 
> Thanks for looking into it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)