env.js 829 B

12345678910111213141516
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.isPhantomJS = exports.isIE9 = exports.isIE = exports.isFF = exports.isEdge = exports.isChrome = exports.inBrowser = exports.UA = void 0;
  6. /* eslint-disable no-undef */
  7. // Browser environment sniffing
  8. const inBrowser = exports.inBrowser = typeof window !== 'undefined';
  9. const UA = exports.UA = inBrowser && window.navigator.userAgent.toLowerCase();
  10. const isIE = exports.isIE = UA && /msie|trident/.test(UA);
  11. const isIE9 = exports.isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  12. const isEdge = exports.isEdge = UA && UA.indexOf('edge/') > 0;
  13. const isChrome = exports.isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  14. const isPhantomJS = exports.isPhantomJS = UA && /phantomjs/.test(UA);
  15. const isFF = exports.isFF = UA && UA.match(/firefox\/(\d+)/);