SmartIT_Extensions/BMC/smart-it-full/scripts/app/common/browser-service.js

18 lines
828 B
JavaScript

"use strict";
(function () {
'use strict';
angular.module('myitsmApp').service('browser', ['$window', function ($window) {
var ua = $window.navigator.userAgent;
this.isFirefox = ua.indexOf('Firefox') != -1;
this.isOpera = ua.indexOf('Opera') != -1;
this.isChrome = ua.indexOf('Chrome') != -1;
this.isSafari = ua.indexOf('Safari') != -1 && !this.isChrome;
this.isWebkit = ua.indexOf('WebKit') != -1;
this.isIE = ua.indexOf('Trident') > 0 || navigator.userAgent.indexOf('MSIE') > 0;
this.isIE9 = ua.indexOf('MSIE 9') > 0;
this.isIE10 = ua.indexOf('MSIE 10') > 0;
this.isIE11 = ua.indexOf('MSIE') == -1 && ua.indexOf('Trident') > 0;
this.isEdge = ua.indexOf('Edge') > -1;
}]);
}());