Skip to content

Commit

Permalink
simplify getBrowser
Browse files Browse the repository at this point in the history
  • Loading branch information
parasharrajat committed Sep 17, 2021
1 parent 609db82 commit de5f727
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/libs/getBrowser/index.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ function getBrowser() {
}

if (match[1] && (match[1].toLowerCase() === 'chrome')) {
temp = userAgent.match(/\b(OPR|Edge)\/(\d+)/);

temp = userAgent.match(/\b(OPR)/);
if (temp !== null) {
return temp.slice(1).join(' ').replace('OPR', 'Opera');
return 'Opera';
}

temp = userAgent.match(/\b(Edg)\/(\d+)/);

temp = userAgent.match(/\b(Edg)/);
if (temp !== null) {
return temp.slice(1).join(' ').replace('Edg', 'Edge');
return 'Edge';
}
}

Expand Down

0 comments on commit de5f727

Please sign in to comment.