UNPKG

@antv/g6-pc

Version:

A Graph Visualization Framework in JavaScript

20 lines (19 loc) 657 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getBrowserName = void 0; /** * Get current browser name. * @returns browser name */ var getBrowserName = exports.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'; };