Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #34 from mozilla/ie11
Browse files Browse the repository at this point in the history
Fix the UA sniffing to handle IE11
  • Loading branch information
seanmonstar committed Oct 1, 2013
2 parents ebc3477 + b256f58 commit 2c9c964
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion winchan.js
Expand Up @@ -14,15 +14,24 @@
else if (w.removeEventListener) w.removeEventListener(event, cb, false);
}


// checking for IE8 or above
function isInternetExplorer() {
var rv = -1; // Return value assumes failure.
var ua = navigator.userAgent;
if (navigator.appName === 'Microsoft Internet Explorer') {
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat(RegExp.$1);
}
// IE > 11
else if (ua.indexOf("Trident") > -1) {
var re = new RegExp("rv:([0-9]{2,2}[\.0-9]{0,})");
if (re.exec(ua) !== null) {
rv = parseFloat(RegExp.$1);
}
}

return rv >= 8;
}

Expand Down

0 comments on commit 2c9c964

Please sign in to comment.