@sebgroup/frontend-tools
Version:
A set of frontend tools
39 lines (36 loc) • 1.1 kB
JavaScript
import { isBrowserOpera } from '../isBrowserOpera/isBrowserOpera.js';
import { isBrowserFirefox } from '../isBrowserFirefox/isBrowserFirefox.js';
import { isBrowserSafari } from '../isBrowserSafari/isBrowserSafari.js';
import { isBrowserChrome } from '../isBrowserChrome/isBrowserChrome.js';
import { isBrowserIE } from '../isBrowserIE/isBrowserIE.js';
import { isBrowserEdge } from '../isBrowserEdge/isBrowserEdge.js';
/**
* Get the name of the current browser
* @note The method detects the browser by features
* @returns {string} The name of the browser
*/
function getBrowserName() {
if (isBrowserOpera()) {
return "Opera";
}
else if (isBrowserFirefox()) {
return "Firefox";
}
else if (isBrowserSafari()) {
return "Safari";
}
else if (isBrowserIE()) {
return "IE";
}
else if (isBrowserEdge()) {
return "Edge";
}
else if (isBrowserChrome()) {
return "Chrome";
}
else {
return "";
}
}
export { getBrowserName };
//# sourceMappingURL=getBrowserName.js.map