bowser
bowser copied to clipboard
iPadOS Safari 13 is detected as Safari 13 on MacOS 10.15
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.
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.
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.
Check for touch — luckily macs don’t have it (yet).
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? 👍
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.
Ok good to know, I'll implement it outside in our device utils scripts.
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.
To switch from desktop to mobile mode in your iPad:
- 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.
Please check after this settings update. you will get the user agent as iPad.
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".
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
Is this still going to be addressed? I need to find a solution to this issue quickly...
found another workaround here using WebGL : https://stackoverflow.com/a/60553965