mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 17:53:44 +08:00
15 lines
356 B
TypeScript
15 lines
356 B
TypeScript
// get the system os
|
|
// according to UA
|
|
export default function getSystem() {
|
|
const ua = navigator.userAgent;
|
|
const platform = OS_PLATFORM;
|
|
|
|
if (ua.includes("Mac OS X") || platform === "darwin") return "macos";
|
|
|
|
if (/win64|win32/i.test(ua) || platform === "win32") return "windows";
|
|
|
|
if (/linux/i.test(ua)) return "linux";
|
|
|
|
return "unknown";
|
|
}
|