Created
July 31, 2020 16:20
-
-
Save jwatney/ab2a6e104945d38ac1abf307dcda2a9c to your computer and use it in GitHub Desktop.
Determines if the browser is IE and which version.
This file contains hidden or 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 Browser = (function() { | |
'use strict'; | |
var version = -1; | |
var isIE = false; | |
var map = { | |
'5.6': 6, | |
'5.7': 7, | |
'5.8': 8, | |
'9': 9, | |
'10': 10, | |
'11': 11 | |
}; | |
var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')(); | |
if(jscriptVersion !== undefined || !!window.msCrypto) { | |
isIE = true; | |
version = map[jscriptVersion || '11']; | |
} | |
return { | |
isIE: isIE, | |
version: version | |
}; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment