Skip to content

Support for navigator in Safari on iPad with iOS 13 or later #660

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

Merged
merged 3 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aframe/build/aframe-ar-new-location-only.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aframe/build/aframe-ar-new-location-only.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aframe/build/aframe-ar-nft.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aframe/build/aframe-ar-nft.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aframe/build/aframe-ar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aframe/build/aframe-ar.mjs

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion aframe/src/new-location-based/gps-new-camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ AFRAME.registerComponent("gps-new-camera", {
if (
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
navigator.userAgent,
)
) ||
(/Macintosh/i.test(navigator.userAgent) &&
navigator.maxTouchPoints != null &&
navigator.maxTouchPoints > 1) // for iPad Safari
) {
// true for mobile device
return true;
Expand Down
2 changes: 1 addition & 1 deletion three.js/build/ar-threex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion three.js/build/ar-threex.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion three.js/build/ar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion three.js/build/ar.mjs

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion three.js/examples/location-based/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ function main() {
}

function isMobile() {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ||
(/Macintosh/i.test(navigator.userAgent) && navigator.maxTouchPoints != null && navigator.maxTouchPoints > 1) // for iPad Safari
) {
// true for mobile device
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion three.js/examples/vendor/webvr-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -5431,7 +5431,7 @@ Util.lerp = function(a, b, t) {
};

Util.isIOS = (function() {
var isIOS = /iPad|iPhone|iPod/.test(navigator.platform);
var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) || (/Macintosh/.test(navigator.userAgent) && navigator.maxTouchPoints != null && navigator.maxTouchPoints > 1);
return function() {
return isIOS;
};
Expand Down
3 changes: 3 additions & 0 deletions three.js/src/threex/arjs-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Profile.prototype._guessPerformanceLabel = function () {
navigator.userAgent.match(/webOS/i) ||
navigator.userAgent.match(/iPhone/i) ||
navigator.userAgent.match(/iPad/i) ||
(navigator.userAgent.match(/Macintosh/i) &&
navigator.maxTouchPoints != null &&
navigator.maxTouchPoints > 1) || // for iPad Safari
navigator.userAgent.match(/iPod/i) ||
navigator.userAgent.match(/BlackBerry/i) ||
navigator.userAgent.match(/Windows Phone/i)
Expand Down