Skip to content

Commit 9c54421

Browse files
committed
Update IE8/IE7 object detection
1 parent 8df96a4 commit 9c54421

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

data/js/detect/os.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -964,13 +964,10 @@ window.os_detect.getVersion = function(){
964964

965965
// IE8 detection straight from IEBlog. Thank you Microsoft.
966966
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";
967+
if (css_is_valid('display', 'display', 'table-cell')) {
968+
ua_version = '8.0';
969+
} else {
970+
ua_version = '7.0';
974971
}
975972
}
976973
} else if (document.compatMode) {

0 commit comments

Comments
 (0)