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

iPadOS 13 Safari not detected as (is)Tablet or (is)iPad #795

Closed
AdmDevelopment opened this issue Jun 11, 2019 · 9 comments
Closed

iPadOS 13 Safari not detected as (is)Tablet or (is)iPad #795

AdmDevelopment opened this issue Jun 11, 2019 · 9 comments

Comments

@AdmDevelopment
Copy link

Issue description
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. Mobiledetect currently thinks the iPad is a Mac using safari.

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

User-Agent(s)
iPad user agent in iPadOS 13 beta using Safari 13:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15

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

screenshot

@phamhung159
Copy link

you can check this link https://qiita.com/mtdune/items/97abb9c0bd926d4c8a13

@serbanghita
Copy link
Owner

@AdmDevelopment thanks for posting such a detailed report on how iPadOS reports the user-agent. I will have to put this into the KNOWN_LIMITATIONS section because there is no way to tell that is a mobile Safari coming from the new Apple device.

@phamhung159 that seems like a client-side technique.

@Tristanlogd
Copy link

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.

@serbanghita
Copy link
Owner

@Tristanlogd thank you for clarifying, I was just reading the conversation at hgoebl/mobile-detect.js#95 (comment)

We're currently stuck with Intel Mac OS X 10_15 by default apparently.

@karthejay
Copy link

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.

@zengyuangai
Copy link

'PointerEvent' in window

@rikinshah23
Copy link

@Tristanlogd @karthejay what could be solution at this time then?
I cannot ask user to turn off desktop website option.
https://stackoverflow.com/questions/58344491/request-browser-ismobiledevice-not-working-with-ipadair2-and-ios-13-0-1

Badly stuck here. need to check IsMobileDevice on server side.

@emaillenin
Copy link

Apple wants the server to believe the user is using a desktop.

dinuionut added a commit to jobstertheme/Mobile-Detect that referenced this issue Jul 10, 2020
Mac Safari
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15

iPad Safari
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15

iPad Ionic App Webview 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148

Related:
https://developer.apple.com/forums/thread/119186
serbanghita#554
serbanghita#795
serbanghita#809
serbanghita#820
serbanghita#827
@rhaimann
Copy link

This is messing up a web app I am working on where I want a fixed background for everything EXCEPT iphone and ipads since those devices do not support fixed backgrounds. I've coded sequenced loading of images based on scroll position and load images of varying resolution based on client screen size so as to not overload client memory. I need to modify the style settings for the background for iPhone and iPad in order to stop background image glitching that occurs. Easy enough for iphone and older iPads, but new iPad user-agents replicate Mac user-agents as discussed above.

Closest solution I am coming up with is to write a function to identify if the client is a touch screen or not. Still, macs with touch screens will probably fail that and those clients will wind up scrolling the backgrounds and having background resolution/glitch issues. Unfortunate oversight on the part of Apple, IMHO, unless there is a way to make fixed backgrounds work on the new more powerful iPads someone knows of, hopefully without endless hours of coding animation.

https://stackoverflow.com/questions/56934826/distinguish-between-ipad-and-mac-on-ipad-with-ipados

https://stackoverflow.com/questions/56578799/tell-ipados-from-macos-on-the-web

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

No branches or pull requests

9 participants