@plattar/plattar-ar-adapter 1.139.2 → 1.140.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2730,63 +2730,65 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2730
2730
  _createClass(Util, null, [{
2731
2731
  key: "canAugment",
2732
2732
  value: function canAugment() {
2733
- var userAgent = navigator.userAgent;
2734
- // test google chrome on IOS and standard IOS test
2735
- if ((/CriOS/i.test(userAgent) || /Macintosh|iPad|iPhone|iPod/.test(userAgent)) && !window.MSStream) {
2736
- // inside facebook browser
2737
- if (/\bFB[\w_]+\//.test(userAgent)) {
2738
- return false;
2739
- }
2740
- // inside instagram browser
2741
- if (/\bInstagram/i.test(userAgent)) {
2742
- return false;
2743
- }
2744
- return Util.canQuicklook();
2745
- } else if (/android/i.test(userAgent)) {
2746
- return true;
2747
- }
2748
- return false;
2733
+ return Util.canQuicklook() || Util.canSceneViewer();
2749
2734
  }
2750
2735
  }, {
2751
2736
  key: "canQuicklook",
2752
2737
  value: function canQuicklook() {
2753
- var tempAnchor = document.createElement("a");
2754
- return tempAnchor.relList && tempAnchor.relList.supports && tempAnchor.relList.supports("ar");
2738
+ if (Util.isIOS()) {
2739
+ var isWKWebView = Boolean((window && window).webkit && window.webkit.messageHandlers);
2740
+ if (isWKWebView) {
2741
+ return Boolean(/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//.test(navigator.userAgent));
2742
+ }
2743
+ var tempAnchor = document.createElement("a");
2744
+ return tempAnchor.relList && tempAnchor.relList.supports && tempAnchor.relList.supports("ar");
2745
+ }
2746
+ return false;
2755
2747
  }
2756
2748
  }, {
2757
2749
  key: "canSceneViewer",
2758
2750
  value: function canSceneViewer() {
2759
- return Util.canAugment() && /android/i.test(navigator.userAgent);
2751
+ return Util.isAndroid() && !Util.isFirefox() && !Util.isOculus();
2760
2752
  }
2761
2753
  }, {
2762
2754
  key: "canRealityViewer",
2763
2755
  value: function canRealityViewer() {
2764
- if (!Util.canAugment()) {
2765
- return false;
2766
- }
2767
- if (/Macintosh|iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
2768
- if (Util.isSafari() && Util.getIOSVersion()[0] >= 13) {
2769
- return true;
2770
- }
2771
- }
2772
- return false;
2756
+ return Util.isIOS() && Util.getIOSVersion()[0] >= 13;
2773
2757
  }
2774
2758
  }, {
2775
- key: "isSafari",
2776
- value: function isSafari() {
2777
- if (navigator.vendor && navigator.userAgent) {
2778
- return navigator.vendor.indexOf("Apple") > -1 && navigator.userAgent.indexOf("CriOS") === -1 && navigator.userAgent.indexOf("FxiOS") === -1;
2779
- }
2780
- return false;
2759
+ key: "isSafariOnIOS",
2760
+ value: function isSafariOnIOS() {
2761
+ return Util.isIOS() && Util.isSafari();
2781
2762
  }
2782
2763
  }, {
2783
2764
  key: "isChromeOnIOS",
2784
2765
  value: function isChromeOnIOS() {
2785
- var userAgent = navigator.userAgent;
2786
- if (userAgent) {
2787
- return Util.canAugment() && /CriOS/i.test(userAgent);
2788
- }
2789
- return false;
2766
+ return Util.isIOS() && /CriOS\//.test(navigator.userAgent);
2767
+ }
2768
+ }, {
2769
+ key: "isIOS",
2770
+ value: function isIOS() {
2771
+ return /iPad|iPhone|iPod/.test(navigator.userAgent) && !self.MSStream || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
2772
+ }
2773
+ }, {
2774
+ key: "isAndroid",
2775
+ value: function isAndroid() {
2776
+ return /android/i.test(navigator.userAgent);
2777
+ }
2778
+ }, {
2779
+ key: "isFirefox",
2780
+ value: function isFirefox() {
2781
+ return /firefox/i.test(navigator.userAgent);
2782
+ }
2783
+ }, {
2784
+ key: "isOculus",
2785
+ value: function isOculus() {
2786
+ return /OculusBrowser/.test(navigator.userAgent);
2787
+ }
2788
+ }, {
2789
+ key: "isSafari",
2790
+ value: function isSafari() {
2791
+ return Util.isIOS() && /Safari\//.test(navigator.userAgent);
2790
2792
  }
2791
2793
  }, {
2792
2794
  key: "getIOSVersion",
@@ -2825,7 +2827,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2825
2827
  Object.defineProperty(exports, "__esModule", {
2826
2828
  value: true
2827
2829
  });
2828
- exports["default"] = "1.139.2";
2830
+ exports["default"] = "1.140.2";
2829
2831
  }, {}],
2830
2832
  17: [function (require, module, exports) {
2831
2833
  "use strict";