84 lines
2.1 KiB
JavaScript
84 lines
2.1 KiB
JavaScript
// Metro module 501 (f502).
|
|
let c486_0 = {
|
|
WINDOWS: "WINDOWS",
|
|
OSX: "OSX",
|
|
LINUX: "LINUX",
|
|
WEB: "WEB"
|
|
};
|
|
let c486_1 = true;
|
|
let c486_2 = "android";
|
|
export { c486_0 as PlatformTypes };
|
|
export const isPlatformEmbedded = true;
|
|
export function isWindows() {
|
|
return /^win/.test(c486_2);
|
|
}
|
|
export function isMac() {
|
|
return false;
|
|
}
|
|
export function isLinux() {
|
|
return false;
|
|
}
|
|
export function isDesktop() {
|
|
return /^win/.test(c486_2) || false;
|
|
}
|
|
export function isWeb() {
|
|
return false;
|
|
}
|
|
export function isAndroidChrome() {
|
|
return navigator.userAgent != null && navigator.userAgent.toLowerCase().match("(android ).+chrome/[.0-9]* mobile") != null;
|
|
}
|
|
export function isAndroidWeb() {
|
|
const userAgent = navigator.userAgent;
|
|
return (userAgent == null ? void 0 : userAgent.match(/android/i)) != null;
|
|
}
|
|
export function isMacWeb() {
|
|
const userAgent = navigator.userAgent;
|
|
return (userAgent == null ? void 0 : userAgent.match(/Macintosh/i)) != null;
|
|
}
|
|
export function isAndroid() {
|
|
return true;
|
|
}
|
|
export function isIOS() {
|
|
return false;
|
|
}
|
|
export function isOculusWeb() {
|
|
const userAgent = navigator.userAgent;
|
|
return (userAgent == null ? void 0 : userAgent.match(/OculusBrowser/i)) != null;
|
|
}
|
|
export function platformPrefersDeepLink() {
|
|
const userAgent = navigator.userAgent;
|
|
return (userAgent == null ? void 0 : userAgent.match(/OculusBrowser/i)) != null;
|
|
}
|
|
export function platformSupportsActivityJoin() {
|
|
let r8 = /^win/.test(c486_2) || false;
|
|
if (!r8) {
|
|
const userAgent = navigator.userAgent;
|
|
r8 = (userAgent == null ? void 0 : userAgent.match(/OculusBrowser/i)) != null;
|
|
}
|
|
if (!r8) {
|
|
r8 = c486_1;
|
|
}
|
|
return r8;
|
|
}
|
|
export function getPlatform() {
|
|
return /^win/.test(c486_2) ? c486_0.WINDOWS : c486_0.WEB;
|
|
}
|
|
export function getPlatformName() {
|
|
return c486_2;
|
|
}
|
|
export function getNativePlatform() {
|
|
if (c486_2 !== "ios" && c486_2 !== "android") {
|
|
return "web";
|
|
}
|
|
return c486_2;
|
|
}
|
|
export function getOS() {
|
|
window.navigator.userAgent;
|
|
return "android";
|
|
}
|
|
export function getNewUpdaterPlatformName() {
|
|
if (/^win/.test(c486_2)) {
|
|
return "win";
|
|
}
|
|
}
|