Skip to content

Commit eda8a90

Browse files
author
HD Moore
committed
Fix merge issues with os.js
1 parent ddc8a4f commit eda8a90

File tree

1 file changed

+78
-32
lines changed

1 file changed

+78
-32
lines changed

data/js/detect/os.js

Lines changed: 78 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ window.os_detect.getVersion = function(){
215215
// Thanks to developer.mozilla.org "Firefox for developers" series for most
216216
// of these.
217217
// Release changelogs: http://www.mozilla.org/en-US/firefox/releases/
218-
if (css_is_valid('cursor', 'cursor', 'grab')) {
218+
if (css_is_valid('flex-wrap', 'flexWrap', 'nowrap')) {
219+
ua_version = '28.0';
220+
} else if (css_is_valid('cursor', 'cursor', 'grab')) {
219221
ua_version = '27.0';
220222
} else if (css_is_valid('image-orientation',
221223
'imageOrientation',
@@ -876,7 +878,7 @@ window.os_detect.getVersion = function(){
876878
break;
877879
case "9016464":
878880
// browsershots.org, MSIE 7.0 / Windows 2008 R2
879-
os_name = "Windows 2008R2";
881+
os_name = "Windows 2008 R2";
880882
ua_version = "9.0";
881883
break;
882884
case "9016470":
@@ -885,6 +887,42 @@ window.os_detect.getVersion = function(){
885887
os_name = "Windows 7";
886888
os_sp = "SP1";
887889
break;
890+
case "9016502":
891+
// IE 9.0.8112.16502 / Windows 7 SP1
892+
ua_version = "9.0";
893+
os_name = "Windows 7";
894+
os_sp = "SP1";
895+
break;
896+
case "9016506":
897+
// IE 9.0.8112.16506 / Windows 7 SP1
898+
ua_version = "9.0";
899+
os_name = "Windows 7";
900+
os_sp = "SP1";
901+
break;
902+
case "9016514":
903+
// IE 9.0.8112.16514 / Windows 7 SP1
904+
ua_version = "9.0";
905+
os_name = "Windows 7";
906+
os_sp = "SP1";
907+
break;
908+
case "9016520":
909+
// IE 9.0.8112.16520 / Windows 7 SP1
910+
ua_version = "9.0";
911+
os_name = "Windows 7";
912+
os_sp = "SP1";
913+
break;
914+
case "9016526":
915+
// IE 9.0.8112.16526 / Windows 7 SP1
916+
ua_version = "9.0";
917+
os_name = "Windows 7";
918+
os_sp = "SP1";
919+
break;
920+
case "9016533":
921+
// IE 9.0.8112.16533 / Windows 7 SP1
922+
ua_version = "9.0";
923+
os_name = "Windows 7";
924+
os_sp = "SP1";
925+
break;
888926
case "10016720":
889927
// IE 10.0.9200.16721 / Windows 7 SP1
890928
ua_version = "10.0";
@@ -903,51 +941,59 @@ window.os_detect.getVersion = function(){
903941
os_name = "Windows 8";
904942
os_sp = "SP0";
905943
break;
944+
case "11016426":
945+
// IE 11.0.9600.16476 / KB2898785 (Technically: 11.0.2) Windows 8.1 x86 English
946+
ua_version = "11.0";
947+
os_name = "Windows 8.1";
948+
break;
906949
case "1000":
907950
// IE 10.0.8400.0 (Pre-release + KB2702844), Windows 8 x86 English Pre-release
908951
ua_version = "10.0";
909952
os_name = "Windows 8";
910953
os_sp = "SP0";
911954
break;
912-
case "11016426":
913-
// IE 11.0.9600.16476 / KB2898785 (Technically: 11.0.2) Windows 8.1 x86 English
914-
ua_version = "11.0";
915-
os_name = "Windows 8.1";
916-
break;
917955
default:
918956
unknown_fingerprint = version;
919957
break;
920958
}
921959

922-
// Trust reported versions of 9, 10, and 11 until we have a better method
923-
if (!ua_version) {
924-
switch(version_maj) {
925-
case "11":
926-
ua_version = "11.0";
927-
os_name = "Windows 8.1";
928-
break;
929-
case "10":
930-
ua_version = "10.0";
931-
os_name = "Windows 8";
932-
break;
933-
case "9":
934-
ua_version = "9.0";
935-
break;
936-
}
937-
}
938-
939960
if (!ua_version) {
940961
// The ScriptEngine functions failed us, try some object detection
941962
if (document.documentElement && (typeof document.documentElement.style.maxHeight)!="undefined") {
942-
// IE8 detection straight from IEBlog. Thank you Microsoft.
963+
// IE 11 detection, see: http://msdn.microsoft.com/en-us/library/ie/bg182625(v=vs.85).aspx
943964
try {
944-
// Technically this also applies to 9.0, 10.0, and 11.0...
945-
ua_version = "8.0";
946-
document.documentElement.style.display = "table-cell";
947-
} catch(e) {
948-
// This executes in IE7,
949-
// but not IE8, regardless of mode
950-
ua_version = "7.0";
965+
if (document.__proto__ != undefined) { ua_version = "11.0"; }
966+
} catch (e) {}
967+
968+
// IE 10 detection using nodeName
969+
if (!ua_version) {
970+
try {
971+
var badNode = document.createElement && document.createElement("badname");
972+
if (badNode && badNode.nodeName === "BADNAME") { ua_version = "10.0"; }
973+
} catch(e) {}
974+
}
975+
976+
// IE 9 detection based on a "Object doesn't support property or method" error
977+
if (!ua_version) {
978+
try {
979+
document.BADNAME();
980+
} catch(e) {
981+
if (e.message.indexOf("BADNAME") > 0) {
982+
ua_version = "9.0";
983+
}
984+
}
985+
}
986+
987+
// IE8 detection straight from IEBlog. Thank you Microsoft.
988+
if (!ua_version) {
989+
try {
990+
ua_version = "8.0";
991+
document.documentElement.style.display = "table-cell";
992+
} catch(e) {
993+
// This executes in IE7,
994+
// but not IE8, regardless of mode
995+
ua_version = "7.0";
996+
}
951997
}
952998
} else if (document.compatMode) {
953999
ua_version = "6.0";

0 commit comments

Comments
 (0)