Skip to content

Commit

Permalink
Fix #454 Improve Samsung detection
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Mar 12, 2021
1 parent 6aa3ff1 commit 46615e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@
/smart-tv.+(samsung)/i
], [VENDOR, [TYPE, SMARTTV], MODEL], [
/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,
/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,
/\s(sam)(?:sung)[\s-]([\w-]+)/i,
/sec-((sgh\w+))/i
], [[VENDOR, 'Samsung'], MODEL, [TYPE, MOBILE]], [

Expand Down
9 changes: 9 additions & 0 deletions test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1378,5 +1378,14 @@
"expect": {
"type": "mobile"
}
},
{
"desc": "Issue #454",
"ua": "Mosamzilla/5.0 (Windows; U; Win98; en-US; rv:1.7.5) Gecko/20050603 Netscape/8.0.2",
"expect": {
"vendor": "undefined",
"model": "undefined",
"type": "undefined"
}
}
]

0 comments on commit 46615e7

Please sign in to comment.