File tree Expand file tree Collapse file tree 1 file changed +26
-7
lines changed Expand file tree Collapse file tree 1 file changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -945,14 +945,33 @@ window.os_detect.getVersion = function(){
945
945
if ( ! ua_version ) {
946
946
// The ScriptEngine functions failed us, try some object detection
947
947
if ( document . documentElement && ( typeof document . documentElement . style . maxHeight ) != "undefined" ) {
948
- // IE8 detection straight from IEBlog. Thank you Microsoft.
948
+ // IE 10 detection using nodeName
949
949
try {
950
- ua_version = "8.0" ;
951
- document . documentElement . style . display = "table-cell" ;
952
- } catch ( e ) {
953
- // This executes in IE7,
954
- // but not IE8, regardless of mode
955
- ua_version = "7.0" ;
950
+ var badNode = document . createElement && document . createElement ( "badname" ) ;
951
+ if ( badNode && badNode . nodeName === "BADNAME" ) { ua_version = "10.0" ; }
952
+ } catch ( e ) { }
953
+
954
+ // IE 9 detection based on a "Object doesn't support property or method" error
955
+ if ( ! ua_version ) {
956
+ try {
957
+ document . BADNAME ( ) ;
958
+ } catch ( e ) {
959
+ if ( e . message . indexOf ( "BADNAME" ) > 0 ) {
960
+ ua_version = "9.0" ;
961
+ }
962
+ }
963
+ }
964
+
965
+ // IE8 detection straight from IEBlog. Thank you Microsoft.
966
+ if ( ! ua_version ) {
967
+ try {
968
+ ua_version = "8.0" ;
969
+ document . documentElement . style . display = "table-cell" ;
970
+ } catch ( e ) {
971
+ // This executes in IE7,
972
+ // but not IE8, regardless of mode
973
+ ua_version = "7.0" ;
974
+ }
956
975
}
957
976
} else if ( document . compatMode ) {
958
977
ua_version = "6.0" ;
You can’t perform that action at this time.
0 commit comments