Commit 45c58173 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Fix IS_IOS detection in the dino

Xcode11 / iOS 13 starts to return different values for navigator.platform
IS_IOS checks value of navigator.platform. iOS 13 iPads are returning
"MacIntel" for both simulator and devices. Changed regex to accept that.

Bug: 1008774
Change-Id: I25000d5baf48cc5476415cfe4d284c3dcd6652b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832210
Auto-Submit: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarHector Carmona <hcarmona@chromium.org>
Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701943}
parent af2cdbfc
...@@ -93,7 +93,14 @@ var FPS = 60; ...@@ -93,7 +93,14 @@ var FPS = 60;
var IS_HIDPI = window.devicePixelRatio > 1; var IS_HIDPI = window.devicePixelRatio > 1;
/** @const */ /** @const */
var IS_IOS = /iPad|iPhone|iPod/.test(window.navigator.platform); // iPads are returning "MacIntel" for iOS 13 (devices & simulators).
// Chrome on macOS also returns "MacIntel" for navigator.platform,
// but navigator.userAgent includes /Safari/.
// TODO(crbug.com/998999): Fix navigator.userAgent such that it reliably
// returns an agent string containing "CriOS".
var IS_IOS = /iPad|iPhone|iPod|MacIntel/.test(navigator.platform) &&
!(/Safari/.test(navigator.userAgent));
/** @const */ /** @const */
var IS_MOBILE = /Android/.test(window.navigator.userAgent) || IS_IOS; var IS_MOBILE = /Android/.test(window.navigator.userAgent) || IS_IOS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment