Files
railwaysystem/RuoYi-Vue/ruoyi-ui/node_modules1/@antv/g6-pc/es/util/browser.js
T
2026-09-10 15:40:10 +08:00

14 lines
526 B
JavaScript

/**
* Get current browser name.
* @returns browser name
*/
export var getBrowserName = function getBrowserName() {
var userAgent = navigator.userAgent.toLowerCase();
if (userAgent.indexOf('firefox') > -1) return 'firefox';
if (userAgent.indexOf('safari') > -1) return 'safari';
if (userAgent.indexOf('opr') > -1) return 'opera';
if (userAgent.indexOf('chrome') > -1) return 'chrome';
if (userAgent.indexOf('trident') > -1) return 'ie 11';
if (userAgent.indexOf('ie') > -1) return 'ie';
return 'unknown';
};