@robotical/webapp-types 3.16.19 → 3.16.20
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.
|
@@ -38,7 +38,7 @@ function getDevicePlatform(runtime, osName, isTablet) {
|
|
|
38
38
|
return "web-tablet";
|
|
39
39
|
if (isIOS || isAndroid)
|
|
40
40
|
return "web-phone";
|
|
41
|
-
if (osName === "Windows" || osName === "MacOS" || osName === "Linux")
|
|
41
|
+
if (osName === "Windows" || osName === "MacOS" || osName === "Linux" || osName === "ChromeOS")
|
|
42
42
|
return "web-desktop";
|
|
43
43
|
return "unknown";
|
|
44
44
|
}
|
|
@@ -66,6 +66,8 @@ function normalizeOSName(value) {
|
|
|
66
66
|
return "iOS";
|
|
67
67
|
if (lower.includes("android"))
|
|
68
68
|
return "Android";
|
|
69
|
+
if (lower.includes("chromeos") || lower.includes("chrome os") || lower.includes("cros") || lower.includes("chromebook"))
|
|
70
|
+
return "ChromeOS";
|
|
69
71
|
if (lower.includes("windows"))
|
|
70
72
|
return "Windows";
|
|
71
73
|
if (lower.includes("mac"))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const getOrGenerateDeviceId: () => string;
|
|
2
|
-
export declare const getOSName: () => "Windows" | "Android" | "iOS" | "MacOS" | "Linux" | "Unknown OS";
|
|
2
|
+
export declare const getOSName: () => "Windows" | "Android" | "iOS" | "ChromeOS" | "MacOS" | "Linux" | "Unknown OS";
|
|
3
3
|
export declare const getBrowserVersion: () => string;
|
|
4
4
|
export declare const isTablet: () => boolean;
|
|
@@ -20,6 +20,8 @@ export var getOSName = function () {
|
|
|
20
20
|
return "Android";
|
|
21
21
|
if (/iPad|iPhone|iPod/i.test(userAgent) || userAgent.includes("like Mac") || isIPadOSBrowser)
|
|
22
22
|
return "iOS";
|
|
23
|
+
if (/CrOS|Chrome OS|Chromebook/i.test(userAgent))
|
|
24
|
+
return "ChromeOS";
|
|
23
25
|
if (userAgent.includes("Mac"))
|
|
24
26
|
return "MacOS";
|
|
25
27
|
if (userAgent.includes("Linux"))
|