Files
clash-verge-rev/src/utils/get-system.ts
T
Slinetrac c672a6fef3 refactor: lint (#6511)
* refactor: lint

* chore: remove eslint-plugin/config-prettier
2026-03-15 07:40:11 +00:00

15 lines
350 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'
}