Path: blob/master/src/packages/next/lib/share/feature.ts
1450 views
/* NOTE: There is similar (but currently insanely convoluted)1functionality in @cocalc/frontend/feature.ts.2*/34declare var window;5export function isIOS(): boolean {6if (typeof window == "undefined") return false;7const { navigator } = window;8return (9navigator?.userAgent?.match(/Mac/) &&10navigator.maxTouchPoints &&11navigator.maxTouchPoints > 212);13}1415export function isSafari(): boolean {16if (typeof window == "undefined") return false;17if (isChrome()) return false;18const { navigator } = window;19return navigator?.userAgent?.match(/Safari/);20}2122export function isChrome(): boolean {23if (typeof window == "undefined") return false;24const { navigator } = window;25return /Chrom(e|ium)/.test(navigator?.userAgent ?? "");26}272829