]>
Commit | Line | Data |
---|---|---|
1 | function isIOS () { | |
2 | if (/iPad|iPhone|iPod/.test(navigator.platform)) { | |
3 | return true | |
4 | } | |
5 | ||
6 | // Detect iPad Desktop mode | |
7 | return !!(navigator.maxTouchPoints && | |
8 | navigator.maxTouchPoints > 2 && | |
9 | navigator.platform.includes('MacIntel')) | |
10 | } | |
11 | ||
12 | function isSafari () { | |
13 | return /^((?!chrome|android).)*safari/i.test(navigator.userAgent) | |
14 | } | |
15 | ||
16 | function isMobile () { | |
17 | return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent) | |
18 | } | |
19 | ||
20 | export { | |
21 | isIOS, | |
22 | isSafari, | |
23 | isMobile | |
24 | } |