bowser icon indicating copy to clipboard operation
bowser copied to clipboard

iPadOS Safari 13 is detected as Safari 13 on MacOS 10.15

Open AdmDevelopment opened this issue 5 years ago • 12 comments

window.navigator.userAgent of the browser is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15 And it's detected like Safari 13 on MacOS 10.15 on desktop platform However, the real name of the browser is Safari 13 on IpadOS 13 Beta on tablet platform

Using iPadOS 13.0 Beta (1) Safari is sending the User Agent of it's MacOS counterpart. By default Safari will now request the desktop websites on the iPad.

In slideover mode Safari does request the mobile website and sends the "iPad user agent" with the request.

Would be great if we could somehow detect Safari in normal window mode on the iPad and determine it is a Tablet or iPad.

AdmDevelopment avatar Jun 11 '19 13:06 AdmDevelopment

Wow, it's getting harder to distinguish the browsers :) I don't think we can understand that it differs from MacOS, but I'll try to figure out, how we can solve that.

lancedikson avatar Jun 16 '19 21:06 lancedikson

I believe this is an intentional decision on Apple's part. They want the iPad to have a desktop browser experience and are intentionally specifying a macOS UA to accomplish this.

derekdowling avatar Jun 25 '19 22:06 derekdowling

Check for touch — luckily macs don’t have it (yet).

piskov avatar Aug 09 '19 11:08 piskov

We are using bowser in a hybrid app and iPadOS 13 beta 8 gives us the following user agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15

Do you intent to support this or should we make a seperate detection using touch for example? 👍

naranjamecanica avatar Sep 12 '19 12:09 naranjamecanica

Hi, @naranjamecanica. Bowser has always been a library that only parses UA, so we won't include any dependency on window or any other global objects inside. Thus, if check for touch means testing the TouchEvent and its presence in the browser, then I'd say that bowser won't implement this and it's better to add an extra check outside.

lancedikson avatar Sep 12 '19 13:09 lancedikson

Ok good to know, I'll implement it outside in our device utils scripts.

naranjamecanica avatar Sep 13 '19 11:09 naranjamecanica

This is actually an option Apple has turned on by default, they are falsely claiming in the user agent that the user is running MacOS 10.15 and an intel chip. You can turn this option off under Settings - Safari - Request Desktop Website on - All Websites

This should not be on by default in my opinion, it’s actually not accurate at all.

Tristanlogd avatar Sep 20 '19 18:09 Tristanlogd

To switch from desktop to mobile mode in your iPad:

  1. Go to the Settings > Safari > Request Desktop Website.
  2. Under the Request Desktop Website On section, click All Websites to turn off/grey out the toggle.
    When the All Websites toggle is greyed out.

Please check after this settings update. you will get the user agent as iPad.

karthejay avatar Oct 04 '19 09:10 karthejay

I tried this: Go to the Settings > Safari > Request Desktop Website. Under the Request Desktop Website On section, click All Websites to turn off/grey out the toggle. When the All Websites toggle is greyed out.

And UserAgent still reports "Macintosh".

ghost avatar Oct 17 '19 21:10 ghost

Seems currently this detects IOS 13 iPad: navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1 or look at https://www.npmjs.com/package/react-device-detect, it already has support for that

deser avatar Jan 26 '20 19:01 deser

Is this still going to be addressed? I need to find a solution to this issue quickly...

ColtonPhillips avatar Feb 27 '20 01:02 ColtonPhillips

found another workaround here using WebGL : https://stackoverflow.com/a/60553965

acailly avatar Apr 27 '20 14:04 acailly