Spaces:
Paused
Paused
Download apps/web/src/lib/browser.ts from nathycodes/presentercoach: direct link, hf CLI and curl.
- Browser
- Download file 589 Bytes
-
https://huggingface.co/spaces/nathycodes/presentercoach/resolve/main/apps/web/src/lib/browser.ts
- Command line
-
hf download hf://spaces/nathycodes/presentercoach/apps/web/src/lib/browser.ts
-
curl -L -o browser.ts https://huggingface.co/spaces/nathycodes/presentercoach/resolve/main/apps/web/src/lib/browser.ts
589 Bytes
| export const isAppleWebKitMobile = () => { | |
| if (typeof window === "undefined") { | |
| return false; | |
| } | |
| const ua = window.navigator.userAgent; | |
| const isIOS = | |
| /iPad|iPhone|iPod/i.test(ua) || | |
| (window.navigator.platform === "MacIntel" && window.navigator.maxTouchPoints > 1); | |
| return isIOS; | |
| }; | |
| export const isSafariBrowser = () => { | |
| if (typeof window === "undefined") { | |
| return false; | |
| } | |
| if (isAppleWebKitMobile()) { | |
| return true; | |
| } | |
| const userAgent = window.navigator.userAgent; | |
| return /safari/i.test(userAgent) && !/chrome|crios|android/i.test(userAgent); | |
| }; | |