mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 12:50:01 +00:00
web/lib/device: fix ipad recognition
This commit is contained in:
parent
d1767c550c
commit
bc63b0c6b7
1 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
const ua = navigator.userAgent.toLowerCase();
|
const ua = navigator.userAgent.toLowerCase();
|
||||||
|
|
||||||
const iPad = ua.includes("mac os") && navigator.maxTouchPoints > 0;
|
|
||||||
const iPhone = ua.includes("iphone os");
|
const iPhone = ua.includes("iphone os");
|
||||||
|
const iPad = !iPhone && ua.includes("mac os") && navigator.maxTouchPoints > 0;
|
||||||
|
|
||||||
const iOS = iPhone || iPad;
|
const iOS = iPhone || iPad;
|
||||||
const android = ua.includes("android") || ua.includes("diordna");
|
const android = ua.includes("android") || ua.includes("diordna");
|
||||||
|
@ -14,8 +14,8 @@ const installed = window.matchMedia('(display-mode: standalone)').matches;
|
||||||
|
|
||||||
const device = {
|
const device = {
|
||||||
is: {
|
is: {
|
||||||
iPad,
|
|
||||||
iPhone,
|
iPhone,
|
||||||
|
iPad,
|
||||||
iOS,
|
iOS,
|
||||||
android,
|
android,
|
||||||
mobile,
|
mobile,
|
||||||
|
|
Loading…
Reference in a new issue