Created
March 30, 2012 04:19
-
-
Save ariya/2246447 to your computer and use it in GitHub Desktop.
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
// http://ie.microsoft.com/testdrive/Performance/BetaFishIE/Default.html | |
if (userAgent.indexOf('msie') > -1) { | |
index = userAgent.indexOf('msie'); | |
this.browserCheck = "IE"; | |
this.browserName = "Internet Explorer"; | |
this.browserVersion = "" + parseFloat('' + userAgent.substring(index + 5)); | |
this.browserTransform = "msTransform"; | |
} | |
else if (userAgent.indexOf('chrome') > -1) { | |
index = userAgent.indexOf('chrome'); | |
this.browserCheck = "Chrome"; | |
this.browserName = "Google Chrome"; | |
this.browserVersion = "" + parseFloat('' + userAgent.substring(index + 7)); | |
this.browserTransform = "WebkitTransform"; | |
} | |
else if (userAgent.indexOf('firefox') > -1) { | |
index = userAgent.indexOf('firefox'); | |
this.browserCheck = "Firefox"; | |
this.browserName = "Mozilla Firefox"; | |
this.browserVersion = "" + parseFloat('' + userAgent.substring(index + 8)); | |
this.browserTransform = "MozTransform"; | |
} | |
else if (userAgent.indexOf('minefield') > -1) { | |
index = userAgent.indexOf('minefield'); | |
this.browserCheck = "Firefox"; | |
this.browserName = "Mozilla Firefox Minefield"; | |
this.browserVersion = "" + parseFloat('' + userAgent.substring(index + 10)); | |
this.browserTransform = "MozTransform"; | |
} | |
else if (userAgent.indexOf('opera') > -1) { | |
this.browserCheck = "Opera"; | |
this.browserName = "Opera"; | |
this.browserVersion = ""; | |
this.browserTransform = "OTransform"; | |
} | |
else if (userAgent.indexOf('safari') > -1) { | |
index = userAgent.indexOf('safari'); | |
this.browserCheck = "Safari"; | |
this.browserName = "Apple Safari"; | |
this.browserVersion = "" + parseFloat('' + userAgent.substring(index + 7)); | |
this.browserTransform = "WebkitTransform"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment