Skip to content

Commit 9cb2641

Browse files
Add additional isWebXRAvailable check to isAppleVisionPro to not have a false positive on iPhones / iPads (fix #5605) (#5607)
* Add additional isWebXRAvailable check to isAppleVisionPro to not have a false positive on iPhones / iPads (fix #5605) * Add comment --------- Co-authored-by: Diego Marcos <diego.marcos@gmail.com>
1 parent 9cdc304 commit 9cb2641

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/utils/device.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,10 @@ function isAppleVisionPro () {
127127
// Safari for Apple Vision Pro presents itself as a desktop browser.
128128
var isMacintosh = navigator.userAgent.includes('Macintosh');
129129
// Discriminates between a "real" desktop browser and Safari for Vision Pro.
130-
// Note: need to check for posible false positives on iPhones / iPads.
131130
var hasFiveTouchPoints = navigator.maxTouchPoints === 5;
132-
return isMacintosh && hasFiveTouchPoints;
131+
// isWebXRAvailable discriminates between Vision Pro and iPad / iPhone.
132+
// This will no longer work once WebXR ships in iOS / iPad OS.
133+
return isMacintosh && hasFiveTouchPoints && isWebXRAvailable;
133134
}
134135
module.exports.isAppleVisionPro = isAppleVisionPro;
135136

0 commit comments

Comments
 (0)