Skip to content

iPadOS' Safari 13 is not being detected anymore #404

Closed

Description

@mkbctrl

Description

Issue originally occured on the Safari 13.1, newest iPad ( not pro ).

How to reproduce

Example partial we are rendering for mobile and tablet like devices. Works perfectly on Firefox, Chrome, even Edge. Safari 12 is also performing fine.

<% unless browser.device.mobile? || browser.device.tablet? %>
    <%= render "welcome/default/partials/filters/dropdown_manufacturer" %>
<% end %>

You can go to http://vehiculum.de with browserstack in example and the that the filters in the main header of the homepage are behaving differently:

Safari 13:
Screenshot 2019-10-17 at 18 06 51

Safari 12 - desired behavior:
Screenshot 2019-10-17 at 18 07 26

Screenshot 2019-10-17 at 18 08 55

Software:

  • Rails version: 5.1.6.2
  • Browser gem version: 2.5.3

Report

Screenshot 2019-10-17 at 18 12 07

Activity

  1. fnando commented on Oct 17, 2019

    @fnando
    Owner

    Can you paste the actual report url instead of a screenshot? Thanks!

  2. mkbctrl commented on Oct 17, 2019

    @mkbctrl
    Author

    I have updated the gem to the 2.6.1 version. Still no luck. I have also tried silly if statement:

    <% if browser.device.ipad? %>
          <h1>IPAD</h1>
        <% end %>
    

    and suprisingly it does not work on safari 13 as well. Looking for other options...

  3. mkbctrl commented on Oct 18, 2019

    @mkbctrl
    Author

    @fnando do you have any quick ideas about a hacky solution to the problem? From what I have found so far, it will be difficult to parse any info that makes sense, cause it's missing from iPad Safari's user agent.
    The user agent looks the same as the desktop user agent...

    I was thinking about using JS with template tag, to render the contents conditionally based on touch support + screen size, will try to make it work today.

  4. jdittmar commented on Nov 6, 2019

    @jdittmar

    any updates on this @fnando ?

  5. fnando commented on Nov 16, 2019

    @fnando
    Owner

    I finally got the time to handle this issue: the problem is that Safari's user agent doesn't add device identifiers anymore, which means one cannot further detect whether the device is an iPad or not.

  6. fnando commented on Nov 16, 2019

    @fnando
    Owner

    Sent previous message a little bit too early… 🤦‍♂️

    The user agent from my iPad running Safari on ipadOS 13 is Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Safari/605.1.15.

    The user agent we have on file for testing Safari 6 on iPad looks like this: Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25.

    As you can see above, we don't have the iPad token anymore. There isn't much we can do at this point, so I'm closing this issue. If you find an alternative solution, please feel free to let us know.

  7. maguri commented on Dec 4, 2019

    @maguri

    🤷‍♂️ The only "[SOLUTION]" you can do as far as I know now, is to change your Safari Settings manually to set the userAgent as an iPad Request:

    • Open Settings -> Safari -> Request Desktop Website -> All websites. (is enabled by default) -> disabled it.

    🙏 Just praying to Apple dev team to change it!

    @fnando I think this issue shouldn't be closed, add some label if you want, but in my opinion should be Open

  8. zohaib-sarwar-confiz commented on Jan 10, 2020

    @zohaib-sarwar-confiz

    Anyone able to find some sort of solution to this problem. @fnando I agree with @maguri this issue should not be closed as it's not resolved. You are reducing changes, for this issue to get fixed by the rails community by closing it.

  9. mkbctrl commented on Jan 10, 2020

    @mkbctrl
    Author

    From technical perspective @fnando is kind of right. The issue is not directly the gem's issue, as the gem only reads what the browser sends.

    In order to overcome that problem you would need to target iPad with it's screen size and dpi in example to make it work as you want.

  10. reopened this on Jan 10, 2020
  11. fnando commented on Jan 10, 2020

    @fnando
    Owner

    @zohaib-sarwar-confiz As @mkbctrl mentioned, there's no fix for this other than manually changing your iPad's user agent or waiting for Apple to revert this change, as suggested by @maguri.

    I'll left this issue open to give it more visibility. But once again, this cannot be fixed in any way by this gem.

    Just found out Github's pinned tickets. I'm using that!

  12. pinned this issue on Jan 10, 2020
  13. changed the title [-]Support for Safari 13[/-] [+]iPadOS' Safari 13 is not being detected anymore[/+] on Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions