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

ipad still wrong #510

Open
pm100 opened this issue Apr 4, 2022 · 0 comments
Open

ipad still wrong #510

pm100 opened this issue Apr 4, 2022 · 0 comments

Comments

@pm100
Copy link

pm100 commented Apr 4, 2022

I know this was raised and closed before but I wanted to poke at it again

in this long thread this issue is explored https://developer.apple.com/forums/thread/119186

It is caused by the default setting of 'request desktop site' in ipad on safari, it makes its useragent claim that its an intel mac. This is the default setting

The final entry in that conversation has a fix that works

function iOS() {
  return [
    'iPad Simulator',
    'iPhone Simulator',
    'iPod Simulator',
    'iPad',
    'iPhone',
    'iPod'
  ].includes(navigator.platform)
  // iPad on iOS 13 detection
  || (navigator.userAgent.includes("Mac") && "ontouchend" in document)
}

this could be tweaked into working in bowser

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

1 participant