Results 1 to 8 of 8

Thread: Android WebView is incorrectly reported as Safari 4.0

    You found a bug! We've classified it as EXTJS-24896 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium User
    Join Date
    Nov 2015
    Location
    Sydney, Australia
    Posts
    38

    Default Android WebView is incorrectly reported as Safari 4.0

    The Android WebView (stock browser, etc., Chromium-based) user agent is incorrectly identified by Ext JS 6.0.2 and 6.2.0 as Safari 4.0.

    The possible UA formats are described by Google here: https://developer.chrome.com/multide...iew_user_agent

    For example:

    Code:
    Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48B; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.65 Mobile Safari/537.36
    
    Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/_BuildID_) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36
    
    Mozilla/5.0 (Linux; U; Android 4.1.1; en-gb; Build/KLP) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
    At least the stock browsers on Android 5.x and 4.4 are in the Ext JS supported browser list.

    According to MDN (https://developer.mozilla.org/en-US/...the_user_agent), the correct way to detect Safari would be to exclude it if the strings "Chrome" or "Chromium" exist.

    A quick fix in Ext JS would be to place 'chrome' before 'safari' in browserPriority. There should not be any real Safari browser that includes Chrome-like strings in the UA.

  2. #2
    Sencha Premium Member tjstuart's Avatar
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    457

    Default

    Bump. Acknowledgement please.

  3. #3
    Sencha Premium Member tjstuart's Avatar
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    457

    Default

    Bump

  4. #4
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    Hello Bob,

    Can you please clarify.
    How can I reproduce this issue?
    In the Internet browser or should I package my application with Cordova.
    What exactly are you seeing returned as the useragent string?

    I tried to reproduce this issue in a Cordova packaged application on a Nexus Ausus 7 Android 5.1.1
    With the following code:
    Code:
    Ext.Msg.alert('User Agent',Ext.browser.userAgent)
    And received:
    Code:
    Mozilla/5.0 (Linux Android 5.1.1; Nexus 7 Build/LMY47V; wv)
    AppleWbKit/537.36 (KHTML like Gecko) Version /4.0
    Chrome/55.0.288391 Safari/537.36
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  5. #5
    Sencha Premium User
    Join Date
    Nov 2015
    Location
    Sydney, Australia
    Posts
    38

    Default

    The user agent is:

    Code:
    Mozilla/5.0 (Linux; Android 6.0.1; SM-T550 Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 Safari/537.36
    Google documentation says this matches the standard user-agent for a webview: https://developer.chrome.com/multide...iew_user_agent. As far as I know, this would occur as the default everywhere except where an app specifically overrides the user agent.

    This can be seen in the Kiosk Browser Lockdown app: https://play.google.com/store/apps/d...kbrowser&hl=en

    And also in the Cordova Showcase app (using the in-app browser): https://play.google.com/store/apps/d...showcase&hl=en

    Tested on a physical/real SM-T550 (Samsung Galaxy Tab A 9.7") running Android 6.0.1. You can also see the same behaviour by emulating the useragent on any other device, or even the Chrome mobile emulator.





    I'm pretty sure that's because Ext JS is detecting the `Version/4.0` and interpreting it as Safari while ignoring the `Chrome/` part. Some browsers (e.g. Samsung Browser) replace the `Version/4.0` tag with something like `SamsungBrowser/4.0` -- those do not trigger the bug. The user agent you provided has an extra space in there, `Version /4.0`

    The incorrect values can be seen by checking `Ext.platformTags.safari` (which incorrectly returns 4) and `Ext.platformTags.chrome` (incorrectly returns 0).

    More specifically, we encounter this issue while using the tags provided by the Microloader in Ext.beforeLoad, as described/documented here: https://docs.sencha.com/cmd/guides/m...responsiveness

  6. #6
    Sencha Premium Member tjstuart's Avatar
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    457

    Default

    Bump

  7. #7
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  8. #8
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    Thank you for the additional info. I apologize for the delay I missed the email notification of your reply.
    I was able to reproduce this issue and filed a bug.
    The extra space in my useragent was a typpo.
    In the future to expedite the processing of bug reports please use thebug report form.
    Last edited by fmoseley; 1 May 2017 at 2:25 PM. Reason: Update link for How to report a bug
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

Similar Threads

  1. Nothing show in Android Webview.
    By leebyeungok in forum Ext JS 6.x Q&A
    Replies: 1
    Last Post: 16 Nov 2015, 1:30 AM
  2. [FIXED] Version reported incorrectly in non-app Ext file
    By mankz in forum Ext 5: Bugs
    Replies: 2
    Last Post: 18 Aug 2014, 2:26 PM
  3. Sencha Touch 2.0.1 in Android Webview
    By lsadiki in forum Sencha Touch 2.x: Q&A
    Replies: 4
    Last Post: 16 Jan 2013, 6:30 AM
  4. VERY SLOW interactions in android webview
    By mikxman in forum Sencha Touch 1.x: Charts
    Replies: 6
    Last Post: 10 Oct 2012, 6:31 AM
  5. Safari and WebView Memory Management
    By teekong in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 2 Oct 2012, 7:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •