Skip to content

Commit

Permalink
Merge pull request #4 from JasonBenett/master
Browse files Browse the repository at this point in the history
Bugfix on IE and Edge detection
  • Loading branch information
Ahmdrza authored Nov 22, 2018
2 parents 26254f8 + c8adc4b commit 10e780c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions detect-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ function isMobile() {
}

function getBrowserName() {
if (window.chrome) {
return 'Chrome';
}

// Opera 8.0+
if ((window.opr && window.opr.addons)
|| window.opera
Expand All @@ -55,14 +51,19 @@ function getBrowserName() {
}

// Internet Explorer 6-11
if (/* @cc_on!@*/false || document.DOCUMENT_NODE) {
if (/* @cc_on!@*/false || document.documentMode) {
return 'Internet Explorer';
}

// Edge 20+
if (window.styleMedia) {
if (!(document.documentMode) && window.StyleMedia) {
return 'Microsoft Edge';
}

// Chrome
if (window.chrome) {
return 'Chrome';
}
}

function getOSName() {
Expand Down

0 comments on commit 10e780c

Please sign in to comment.