aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/utils/browser.js
blob: 7b8fa5e21112c3c7ceadeb2e34a4b9e615510d9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// ==========================================================================
// Browser sniffing
// Unfortunately, due to mixed support, UA sniffing is required
// ==========================================================================

const browser = {
  isIE: /* @cc_on!@ */ false || !!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),
  isIos: /(iPad|iPhone|iPod)/gi.test(navigator.platform),
};

export default browser;