Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS/iPadOS detected as Mac OS #417

Closed
tpetry opened this issue Mar 9, 2020 · 2 comments
Closed

iOS/iPadOS detected as Mac OS #417

tpetry opened this issue Mar 9, 2020 · 2 comments

Comments

@tpetry
Copy link

tpetry commented Mar 9, 2020

There's a problem detecting iPads with iPad OS (>= 13.x) and any iOS version when requesting the desktop site.

The user agent of normal iOS ipads is looking like this (correctly recognized):
Mozilla/5.0 (iPad; CPU OS 12_4_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148

But when requesting the desktop site (with iOS 12) or iPad OS 13 this user agent is transmitted:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Safari/605.1.15

So ua-parser is seeing the Mac OS X information in the user agent and no longer any iPad information so the user agent is wrongly identified as desktop Mac OS X client.

But as you can see, the real MacOS user agent is a little bit different:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/605.1.15 (KHTML, like Gecko)

The Version/x.y.z information is only present for iOS/iPadOS devices, not for MacOS X devices. But sadly the differentiation from iOS (smartphone) to iPad OS (tablet) is not possible. But maybe it could transport the information that it's an mobile device requesting the desktop site? Because most often it will be an iPadOS because it's now requesting it on default, for iOS the user has to request the desktop site manually everytime.

@tpetry tpetry changed the title IOS/iPadOS detected as Mac OS iOS/iPadOS detected as Mac OS Mar 9, 2020
@vykimo
Copy link

vykimo commented Apr 26, 2020

Related issue : #387

@faisalman
Copy link
Owner

Nice catch, but can it be confirmed that for any Mac user agent with Version/x.y.z they must be originated from iOS/iPadOS only? Because what I found here: https://www.whatismybrowser.com/guides/the-latest-user-agent/safari suggests otherwise.

Related issue : #387

Since the topic is kind of similar, I'm moving this discussion there as I think this finding might be useful there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants