Skip to content

Commit

Permalink
Backport - Fix #624 - Detect Amazon Echo
Browse files Browse the repository at this point in the history
(cherry picked from commit df1a1c7)
  • Loading branch information
faisalman committed Mar 31, 2023
1 parent 3218051 commit ba067bd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@

// Amazon
/(alexa)webm/i,
/(kf[a-z]{2}wi)( bui|\))/i, // Kindle Fire without Silk
/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, // Kindle Fire without Silk / Echo Show
/(kf[a-z]+)( bui|\)).+silk\//i // Kindle Fire HD
], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [
/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i // Fire Phone
Expand Down Expand Up @@ -665,6 +665,8 @@

/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i // Tesla
], [VENDOR, [TYPE, EMBEDDED]], [
/(aeobc)\b/i // Echo Dot
], [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], [

////////////////////
// MIXED (GENERIC)
Expand Down
27 changes: 27 additions & 0 deletions test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,33 @@
"type": "tablet"
}
},
{
"desc": "Echo Show 5",
"ua": "Mozilla/5.0 (Linux; Android 5.1; AEORK Build/LVY48F; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.110 Mobile Safari/537.36",
"expect": {
"vendor": "Amazon",
"model": "AEORK",
"type": "tablet"
}
},
{
"desc": "Echo Show 8",
"ua": "Mozilla/5.0 (Linux; Android 7.1; AEOCH) AppleWebKit/537.36 (KHTML, like Gecko) Silk/77.2.21 like Chrome/77.0.3865.92 Mobile Safari/537.36",
"expect": {
"vendor": "Amazon",
"model": "AEOCH",
"type": "tablet"
}
},
{
"desc": "Echo Dot",
"ua": "Dalvik/2.1.0 (Linux; U; Android 5.1.1; AEOBC Build/LVY48F)",
"expect": {
"vendor": "Amazon",
"model": "AEOBC",
"type": "embedded"
}
},
{
"desc": "Samsung Galaxy A21s",
"ua": "Mozilla/5.0 (Linux; Android 10; SAMSUNG SM-A217F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/11.0 Chrome/75.0.3770.143 Mobile Safari/537.36",
Expand Down

0 comments on commit ba067bd

Please sign in to comment.