Created
October 29, 2014 07:24
-
-
Save sgaurav/d8aa7850fcdaf3319711 to your computer and use it in GitHub Desktop.
Javascript method to detect browser without using UA String
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; | |
var isFirefox = typeof InstallTrigger !== 'undefined'; | |
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; | |
var isChrome = !!window.chrome && !this.isOpera; | |
var isIE = false || !!document.documentMode; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment