aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/utils/browser.js
blob: f8dd36a1fc94dde7869a5273d2f238376545713f (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: 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),
  isIos: /(iPad|iPhone|iPod)/gi.test(navigator.platform),
};

export default browser;