@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.
- package/build/es2015/plattar-ar-adapter.js +42 -40
- package/build/es2015/plattar-ar-adapter.min.js +1 -1
- package/build/es2019/plattar-ar-adapter.js +30 -43
- package/build/es2019/plattar-ar-adapter.min.js +1 -1
- package/dist/util/util.d.ts +6 -1
- package/dist/util/util.js +29 -42
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
|
@@ -2173,58 +2173,45 @@ exports.Util = void 0;
|
|
|
2173
2173
|
*/
|
|
2174
2174
|
class Util {
|
|
2175
2175
|
static canAugment() {
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
// inside instagram browser
|
|
2184
|
-
if (/\bInstagram/i.test(userAgent)) {
|
|
2185
|
-
return false;
|
|
2176
|
+
return Util.canQuicklook() || Util.canSceneViewer();
|
|
2177
|
+
}
|
|
2178
|
+
static canQuicklook() {
|
|
2179
|
+
if (Util.isIOS()) {
|
|
2180
|
+
const isWKWebView = Boolean((window && window).webkit && window.webkit.messageHandlers);
|
|
2181
|
+
if (isWKWebView) {
|
|
2182
|
+
return Boolean(/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//.test(navigator.userAgent));
|
|
2186
2183
|
}
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
else if (/android/i.test(userAgent)) {
|
|
2190
|
-
return true;
|
|
2184
|
+
const tempAnchor = document.createElement("a");
|
|
2185
|
+
return tempAnchor.relList && tempAnchor.relList.supports && tempAnchor.relList.supports("ar");
|
|
2191
2186
|
}
|
|
2192
2187
|
return false;
|
|
2193
2188
|
}
|
|
2194
|
-
static canQuicklook() {
|
|
2195
|
-
const tempAnchor = document.createElement("a");
|
|
2196
|
-
return tempAnchor.relList &&
|
|
2197
|
-
tempAnchor.relList.supports &&
|
|
2198
|
-
tempAnchor.relList.supports("ar");
|
|
2199
|
-
}
|
|
2200
2189
|
static canSceneViewer() {
|
|
2201
|
-
return Util.
|
|
2190
|
+
return Util.isAndroid() && !Util.isFirefox() && !Util.isOculus();
|
|
2202
2191
|
}
|
|
2203
2192
|
static canRealityViewer() {
|
|
2204
|
-
|
|
2205
|
-
return false;
|
|
2206
|
-
}
|
|
2207
|
-
if (/Macintosh|iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
|
|
2208
|
-
if (Util.isSafari() && Util.getIOSVersion()[0] >= 13) {
|
|
2209
|
-
return true;
|
|
2210
|
-
}
|
|
2211
|
-
}
|
|
2212
|
-
return false;
|
|
2193
|
+
return Util.isIOS() && Util.getIOSVersion()[0] >= 13;
|
|
2213
2194
|
}
|
|
2214
|
-
static
|
|
2215
|
-
|
|
2216
|
-
return navigator.vendor.indexOf("Apple") > -1 &&
|
|
2217
|
-
navigator.userAgent.indexOf("CriOS") === -1 &&
|
|
2218
|
-
navigator.userAgent.indexOf("FxiOS") === -1;
|
|
2219
|
-
}
|
|
2220
|
-
return false;
|
|
2195
|
+
static isSafariOnIOS() {
|
|
2196
|
+
return Util.isIOS() && Util.isSafari();
|
|
2221
2197
|
}
|
|
2222
2198
|
static isChromeOnIOS() {
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2199
|
+
return Util.isIOS() && /CriOS\//.test(navigator.userAgent);
|
|
2200
|
+
}
|
|
2201
|
+
static isIOS() {
|
|
2202
|
+
return (/iPad|iPhone|iPod/.test(navigator.userAgent) && !self.MSStream) || (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1);
|
|
2203
|
+
}
|
|
2204
|
+
static isAndroid() {
|
|
2205
|
+
return /android/i.test(navigator.userAgent);
|
|
2206
|
+
}
|
|
2207
|
+
static isFirefox() {
|
|
2208
|
+
return /firefox/i.test(navigator.userAgent);
|
|
2209
|
+
}
|
|
2210
|
+
static isOculus() {
|
|
2211
|
+
return /OculusBrowser/.test(navigator.userAgent);
|
|
2212
|
+
}
|
|
2213
|
+
static isSafari() {
|
|
2214
|
+
return Util.isIOS() && /Safari\//.test(navigator.userAgent);
|
|
2228
2215
|
}
|
|
2229
2216
|
static getIOSVersion() {
|
|
2230
2217
|
if (/iP(hone|od|ad)/.test(navigator.platform)) {
|
|
@@ -2254,7 +2241,7 @@ exports.Util = Util;
|
|
|
2254
2241
|
},{}],16:[function(require,module,exports){
|
|
2255
2242
|
"use strict";
|
|
2256
2243
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2257
|
-
exports.default = "1.
|
|
2244
|
+
exports.default = "1.140.2";
|
|
2258
2245
|
|
|
2259
2246
|
},{}],17:[function(require,module,exports){
|
|
2260
2247
|
"use strict";
|