1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 22:03:36 +00:00
Files
browser/src/services/utilsService.js
2016-09-21 01:17:46 -04:00

23 lines
631 B
JavaScript

function UtilsService() {
initUtilsService();
};
function initUtilsService() {
UtilsService.prototype.getBrowser = function () {
if (navigator.userAgent.indexOf("Firefox") !== -1 || navigator.userAgent.indexOf("Gecko/") !== -1) {
return 'firefox';
}
if ((!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0) {
return 'opera';
}
if (navigator.userAgent.indexOf(" Edge/") !== -1) {
return 'edge';
}
if (window.chrome) {
return 'chrome';
}
return null;
};
};