xous-rs-2024/js/utils/device.js
Sean Cross 5a51f6ddf2 wip commit
Signed-off-by: Sean Cross <sean@xobs.io>
2024-04-06 15:58:08 +08:00

8 lines
308 B
JavaScript

const UA = navigator.userAgent;
export const isMobile = /(iphone|ipod|ipad|android)/gi.test( UA ) ||
( navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1 ); // iPadOS
export const isChrome = /chrome/i.test( UA ) && !/edge/i.test( UA );
export const isAndroid = /android/gi.test( UA );