1
0
Fork 0
why-cant-we-deploy-today/js/utils/device.js

10 lines
297 B
JavaScript
Raw Permalink Normal View History

2020-03-09 18:51:07 +01:00
const UA = navigator.userAgent;
2023-05-23 19:50:14 +02:00
export const isMobile =
/(iphone|ipod|ipad|android)/gi.test(UA) ||
(navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1); // iPadOS
2020-03-09 18:51:07 +01:00
2023-05-23 19:50:14 +02:00
export const isChrome = /chrome/i.test(UA) && !/edge/i.test(UA);
2020-03-09 18:51:07 +01:00
2023-05-23 19:50:14 +02:00
export const isAndroid = /android/gi.test(UA);