Files
DocsGPT/frontend/src/utils/browserUtils.ts
2025-04-10 01:44:49 +05:30

11 lines
304 B
TypeScript

export function getOS() {
const userAgent = window.navigator.userAgent;
if (userAgent.indexOf('Mac') !== -1) return 'mac';
if (userAgent.indexOf('Win') !== -1) return 'win';
return 'linux';
}
export function isTouchDevice() {
return 'ontouchstart' in window || navigator.maxTouchPoints > 0;
}