mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-14 04:10:00 +00:00
web/cobalt.js: enable ios adaptations for ipados
& clean up user agent matching
This commit is contained in:
parent
94b8d647f5
commit
7cf08c5eeb
1 changed files with 5 additions and 5 deletions
|
@ -1,9 +1,9 @@
|
|||
const ua = navigator.userAgent.toLowerCase();
|
||||
const isIOS = ua.match("iphone os");
|
||||
const isMobile = ua.match("android") || ua.match("iphone os");
|
||||
const isSafari = ua.match("safari/");
|
||||
const isFirefox = ua.match("firefox/");
|
||||
const isOldFirefox = ua.match("firefox/") && ua.split("firefox/")[1].split('.')[0] < 103;
|
||||
const isIOS = ua.includes("iphone os") || (ua.includes("mac os") && navigator.maxTouchPoints > 0);
|
||||
const isMobile = ua.includes("android") || ua.includes("iphone os");
|
||||
const isSafari = ua.includes("safari/");
|
||||
const isFirefox = ua.includes("firefox/");
|
||||
const isOldFirefox = ua.includes("firefox/") && ua.split("firefox/")[1].split('.')[0] < 103;
|
||||
|
||||
const switchers = {
|
||||
"theme": ["auto", "light", "dark"],
|
||||
|
|
Loading…
Reference in a new issue