Nertivia-Client/src/utils/Mobile.js
2019-09-02 15:16:23 +01:00

9 lines
329 B
JavaScript

exports.isMobile = () => {
// if we want a more complete list use this: http://detectmobilebrowsers.com/
// str.test() is more efficent than str.match()
// remember str.test is case sensitive
var isMobile = /iphone|ipod|android|ie|blackberry|fennec/.test(
navigator.userAgent.toLowerCase()
);
return isMobile;
};