Skip to content

Commit

Permalink
Fixed compat bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
leoncvlt committed Nov 28, 2024
1 parent 3f33d21 commit 2fdb246
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
13 changes: 4 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export const compat = {
return check;
})(),

IS_ANDROID: /android/i.test(navigator.userAgent),

// Prior to iOS 13, detecting iOS Safari was relatively straight-forward.
// As of iOS 13, Safari on iPad (in its default configuration) reports the same
// user-agent string as Safari on desktop MacOS. Strictly speaking, we only care
Expand All @@ -26,13 +24,10 @@ export const compat = {
// @see https://stackoverflow.com/questions/57765958/how-to-detect-ipad-and-ipad-os-version-in-ios-13-and-up
// @see https://forums.developer.apple.com/thread/119186
// @see https://github.com/google/model-viewer/issues/758
IS_IOS:
(/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) ||
(navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1),

IS_AR_QUICKLOOK_CANDIDATE: (() => {
if (IS_IOS) {
if (!IS_WKWEBVIEW) {
if ((/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) ||
(navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1)) {
if (!Boolean(window.webkit && window.webkit.messageHandlers)) {
const tempAnchor = document.createElement('a');
return Boolean(
tempAnchor.relList && tempAnchor.relList.supports &&
Expand All @@ -47,7 +42,7 @@ export const compat = {
})(),

IS_SCENEVIEWER_CANDIDATE:
IS_ANDROID &&
/android/i.test(navigator.userAgent) &&
!/firefox/i.test(navigator.userAgent) &&
!/OculusBrowser/.test(navigator.userAgent),
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@leoncvlt/ar-button",
"version": "0.3.1",
"version": "0.3.2",
"description": "A web component to easily display 3D models in native AR across browsers and mobile devices",
"keywords": [
"ar",
Expand Down

0 comments on commit 2fdb246

Please sign in to comment.