mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-16 05:09:57 +00:00
14 lines
343 B
TypeScript
14 lines
343 B
TypeScript
|
const ua = navigator.userAgent.toLowerCase();
|
||
|
|
||
|
const isIOS = ua.includes("iphone os") || (ua.includes("mac os") && navigator.maxTouchPoints > 0);
|
||
|
const isAndroid = ua.includes("android") || ua.includes("diordna");
|
||
|
const isMobile = isIOS || isAndroid;
|
||
|
|
||
|
const deviceInfo = {
|
||
|
isIOS,
|
||
|
isAndroid,
|
||
|
isMobile,
|
||
|
}
|
||
|
|
||
|
export default deviceInfo;
|