amos-tool
Version:
amos ui tool
27 lines (25 loc) • 720 B
JavaScript
;
var Browser = {
isFirefox: function() {
return "undefined" != typeof InstallTrigger;
},
isIE: function() {
return !!document.documentMode;
},
isEdge: function() {
return !Browser.isIE() && !!window.StyleMedia;
},
isChrome: function() {
return !!window.chrome && !!window.chrome.webstore;
},
isSafari: function() {
return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor") > 0 || -1 !== navigator.userAgent.toLowerCase().indexOf("safari");
},
wp: function() {
navigator.userAgent.match(/Windows Phone ([\d.]+)/);
},
android: function() {
navigator.userAgent.match(/(Android);?[\s\/]+([\d.]+)?/);
}
};
module.exports = Browser;