Skip to content

Commit

Permalink
Merge pull request muaz-khan#51 from zzxx53/master
Browse files Browse the repository at this point in the history
Fix IE11 version detection
  • Loading branch information
muaz-khan authored Aug 29, 2017
2 parents 8536adc + aa7caf6 commit 016ac82
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
22 changes: 12 additions & 10 deletions DetectRTC.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

// Last Updated On: 2017-08-12 5:13:41 AM UTC
// Last Updated On: 2017-08-28 11:28:27 PM UTC

// ________________
// DetectRTC v1.3.5
Expand Down Expand Up @@ -107,11 +107,17 @@
majorVersion = 0;
}
}
// In MSIE, the true version is after 'MSIE' in userAgent
// In MSIE version <=10, the true version is after 'MSIE' in userAgent
// In IE 11, look for the string after 'rv:'
else if (isIE) {
verOffset = nAgt.indexOf('MSIE');
verOffset = nAgt.indexOf('rv:');
if (verOffset > 0) { //IE 11
fullVersion = nAgt.substring(verOffset + 3);
} else { //IE 10 or earlier
verOffset = nAgt.indexOf('MSIE');
fullVersion = nAgt.substring(verOffset + 5);
}
browserName = 'IE';
fullVersion = nAgt.substring(verOffset + 5);
}
// In Chrome, the true version is after 'Chrome'
else if (isChrome) {
Expand Down Expand Up @@ -152,12 +158,8 @@
fullVersion = parseInt(navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)[2], 10).toString();
}

// trim the fullVersion string at semicolon/space if present
if ((ix = fullVersion.indexOf(';')) !== -1) {
fullVersion = fullVersion.substring(0, ix);
}

if ((ix = fullVersion.indexOf(' ')) !== -1) {
// trim the fullVersion string at semicolon/space/bracket if present
if ((ix = fullVersion.search(/[; \)]/)) !== -1) {
fullVersion = fullVersion.substring(0, ix);
}

Expand Down
Loading

0 comments on commit 016ac82

Please sign in to comment.