Skip to content

Instantly share code, notes, and snippets.

@blubbll
Created December 22, 2019 07:24
Show Gist options
  • Save blubbll/cb3cd97e29687570fcdaf93e4782b8a6 to your computer and use it in GitHub Desktop.
Save blubbll/cb3cd97e29687570fcdaf93e4782b8a6 to your computer and use it in GitHub Desktop.
get ie version by google
tn_.labs.userAgent.browser.getIEVersion_ = function(a) {
var b = /rv: *([\d\.]*)/.exec(a);
if (b && b[1]) return b[1];
b = "";
var c = /MSIE +([\d\.]+)/.exec(a);
if (c && c[1])
if (a = /Trident\/(\d.\d)/.exec(a), "7.0" == c[1])
if (a && a[1]) switch (a[1]) {
case "4.0":
b = "8.0";
break;
case "5.0":
b = "9.0";
break;
case "6.0":
b = "10.0";
break;
case "7.0":
b = "11.0"
} else b = "7.0";
else b = c[1];
return b
};
getIeVersion_(navigator.userAgent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment