Land #3174, @wchen-r7's object detection for ie11

bug/bundler_fix
jvazquez-r7 2014-04-02 15:27:13 -05:00
commit 74554ed805
No known key found for this signature in database
GPG Key ID: 38D99152B9352D83
1 changed files with 11 additions and 4 deletions

View File

@ -945,11 +945,18 @@ window.os_detect.getVersion = function(){
if (!ua_version) {
// The ScriptEngine functions failed us, try some object detection
if (document.documentElement && (typeof document.documentElement.style.maxHeight)!="undefined") {
// IE 10 detection using nodeName
// IE 11 detection, see: http://msdn.microsoft.com/en-us/library/ie/bg182625(v=vs.85).aspx
try {
var badNode = document.createElement && document.createElement("badname");
if (badNode && badNode.nodeName === "BADNAME") { ua_version = "10.0"; }
} catch(e) {}
if (document.__proto__ != undefined) { ua_version = "11.0"; }
} catch (e) {}
// IE 10 detection using nodeName
if (!ua_version) {
try {
var badNode = document.createElement && document.createElement("badname");
if (badNode && badNode.nodeName === "BADNAME") { ua_version = "10.0"; }
} catch(e) {}
}
// IE 9 detection based on a "Object doesn't support property or method" error
if (!ua_version) {