diff --git a/src/js/utils/browser.js b/src/js/utils/browser.js index 6b5e768a..1d485413 100644 --- a/src/js/utils/browser.js +++ b/src/js/utils/browser.js @@ -5,12 +5,11 @@ const browser = { isIE: Boolean(window.document.documentMode), - isEdge: window.navigator.userAgent.includes('Edge'), - isWebkit: 'WebkitAppearance' in document.documentElement.style && !/Edge/.test(navigator.userAgent), - isIPhone: /(iPhone|iPod)/gi.test(navigator.platform), + isEdge: /Edge/g.test(navigator.userAgent), + isWebkit: 'WebkitAppearance' in document.documentElement.style && !/Edge/g.test(navigator.userAgent), + isIPhone: /iPhone|iPod/gi.test(navigator.userAgent) && navigator.maxTouchPoints > 1, isIos: - (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1) || - /(iPad|iPhone|iPod)/gi.test(navigator.platform), + /iPad|iPhone|iPod/gi.test(navigator.userAgent) && navigator.maxTouchPoints > 1 }; export default browser;