Skip to content

Commit

Permalink
implement edge chromium detection support for android (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamonOehlman authored Oct 8, 2020
1 parent da88996 commit 43c2877
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const userAgentRules: UserAgentRule[] = [
['silk', /\bSilk\/([0-9._-]+)\b/],
['miui', /MiuiBrowser\/([0-9\.]+)$/],
['beaker', /BeakerBrowser\/([0-9\.]+)/],
['edge-chromium', /Edg\/([0-9\.]+)/],
['edge-chromium', /EdgA?\/([0-9\.]+)/],
[
'chromium-webview',
/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/,
Expand Down
14 changes: 14 additions & 0 deletions test/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,20 @@ test('detects edge chromium', function(t) {
t.end();
});

test('detects edge chromium (android os)', function(t) {
assertAgentString(
t,
'Mozilla/5.0 (Linux; Android 9; SM-N950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.116 Mobile Safari/537.36 EdgA/45.08.4.5074',
{
type: 'browser',
name: 'edge-chromium',
version: '45.08.4',
os: 'Android OS',
},
);
t.end();
});

test('detects edge iOS', function(t) {
assertAgentString(
t,
Expand Down

0 comments on commit 43c2877

Please sign in to comment.