Skip to content

Commit

Permalink
apache#113 (browser) - Properly detect new Edge Chromium version as E…
Browse files Browse the repository at this point in the history
…dge instead of Chrome
  • Loading branch information
mark-veenstra committed Jan 2, 2020
1 parent 7c0c142 commit 1c8e815
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/browser/DeviceProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,16 @@ function getBrowserInfo (getModel) {
var returnVal = '';
var offset;

if ((offset = userAgent.indexOf('Edge')) !== -1) {
returnVal = (getModel) ? 'Edge' : userAgent.substring(offset + 5);
if ((offset = userAgent.indexOf('Edg')) !== -1) {
if (getModel) {
returnVal = 'Edge';
} else {
if ((offset = userAgent.indexOf('Edge')) !== -1) {
returnVal = userAgent.substring(offset + 5);
} else {
returnVal = userAgent.substring(offset + 4);
}
}
} else if ((offset = userAgent.indexOf('Chrome')) !== -1) {
returnVal = (getModel) ? 'Chrome' : userAgent.substring(offset + 7);
} else if ((offset = userAgent.indexOf('Safari')) !== -1) {
Expand Down

0 comments on commit 1c8e815

Please sign in to comment.