Post

Replies

Boosts

Views

Activity

Reply to User Agent in Safari on iPadOS
Hi, so it looks like User Agent "sniffing" will no longer work for iPad iOS 13+. If you have control over the devices, you could turn off the setting "Request Desktop Website" (Settings -> Safari -> Request Desktop Website (under Settings for Websites), but... I'm assuming you don't have control over the client device settings. Fix: I did find this fix Repeated link if the embedded one doesn't work: (https://stackoverflow.com/questions/9038625/detect-if-device-is-ios). Essentially, just tack on the solution to whatever current User Agent detection you are running. (copied below in case the answer is lost on Stack) 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) }
Topic: App & System Services SubTopic: Core OS Tags:
Feb ’22