Skip to content

Commit

Permalink
Fix #533: Detect Sony BRAVIA as SmartTV
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Dec 18, 2021
1 parent 23ad60e commit 7ddb257
Show file tree
Hide file tree
Showing 2 changed files with 12 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 @@ -488,7 +488,7 @@

// ZTE
/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,
/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i // Alcatel/GeeksPhone/Nexian/Panasonic/Sony
/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i // Alcatel/GeeksPhone/Nexian/Panasonic/Sony
], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [

// Acer
Expand Down Expand Up @@ -616,6 +616,8 @@
], [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], [
/\(dtv[\);].+(aquos)/i // Sharp
], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [
/(bravia[\w- ]+) bui/i // Sony
], [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]], [
/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, // Roku
/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i // HbbTV devices
], [[VENDOR, trim], [MODEL, trim], [TYPE, SMARTTV]], [
Expand Down
9 changes: 9 additions & 0 deletions test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,15 @@
"type": "tablet"
}
},
{
"desc": "Sony BRAVIA 4K GB ATV3",
"ua": "Mozilla/5.0 (Linux; Andr0id 9; BRAVIA 4K GB ATV3 Build/PTT1.190515.001.S38) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36 OPR/46.0.2207.0 OMI/4.13.0.180.DIA5.104 Model/Sony-BRAVIA-4K-GB-ATV3",
"expect": {
"vendor": "Sony",
"model": "BRAVIA 4K GB ATV3",
"type": "smarttv"
}
},
{
"desc" : "Tesla",
"ua" : "Mozilla/5.0 (X11; GNU/Linux) AppleWebKit/601.1 (KHTML, like Gecko) Tesla QtCarBrowser Safari/601.1",
Expand Down

0 comments on commit 7ddb257

Please sign in to comment.