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 ua = navigator.userAgent.toLowerCase();
|
||||||
const isIOS = ua.match("iphone os");
|
const isIOS = ua.includes("iphone os") || (ua.includes("mac os") && navigator.maxTouchPoints > 0);
|
||||||
const isMobile = ua.match("android") || ua.match("iphone os");
|
const isMobile = ua.includes("android") || ua.includes("iphone os");
|
||||||
const isSafari = ua.match("safari/");
|
const isSafari = ua.includes("safari/");
|
||||||
const isFirefox = ua.match("firefox/");
|
const isFirefox = ua.includes("firefox/");
|
||||||
const isOldFirefox = ua.match("firefox/") && ua.split("firefox/")[1].split('.')[0] < 103;
|
const isOldFirefox = ua.includes("firefox/") && ua.split("firefox/")[1].split('.')[0] < 103;
|
||||||
|
|
||||||
const switchers = {
|
const switchers = {
|
||||||
"theme": ["auto", "light", "dark"],
|
"theme": ["auto", "light", "dark"],
|
||||||
|
|
Loading…
Reference in a new issue