env.js 523 B

12345678910
  1. /* eslint-disable no-undef */
  2. // Browser environment sniffing
  3. export const inBrowser = typeof window !== 'undefined';
  4. export const UA = inBrowser && window.navigator.userAgent.toLowerCase();
  5. export const isIE = UA && /msie|trident/.test(UA);
  6. export const isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  7. export const isEdge = UA && UA.indexOf('edge/') > 0;
  8. export const isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  9. export const isPhantomJS = UA && /phantomjs/.test(UA);
  10. export const isFF = UA && UA.match(/firefox\/(\d+)/);