Skip to content

Commit

Permalink
Merge pull request #589 from choo737/master
Browse files Browse the repository at this point in the history
fixed sony bravia smart tv, added sharp AQUOS TV
  • Loading branch information
faisalman authored Sep 18, 2022
2 parents 29b613d + ebb32d1 commit ea04d01
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
MOTOROLA = 'Motorola',
OPERA = 'Opera',
SAMSUNG = 'Samsung',
SHARP = 'Sharp',
SONY = 'Sony',
XIAOMI = 'Xiaomi',
ZEBRA = 'Zebra',
Expand Down Expand Up @@ -504,7 +505,7 @@

// Sharp
/\b(sh-?[altvz]?\d\d[a-ekm]?)/i
], [MODEL, [VENDOR, 'Sharp'], [TYPE, MOBILE]], [
], [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]], [

// MIXED
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,
Expand Down Expand Up @@ -617,8 +618,10 @@
/droid.+aft(\w)( bui|\))/i // Fire TV
], [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], [
/\(dtv[\);].+(aquos)/i // Sharp
], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [
/(bravia[\w- ]+) bui/i // Sony
], [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]], [
/(aquos-tv[\w ]+)\)/i // Sharp
], [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]],[
/(bravia[\w ]+)( bui|\))/i // Sony
], [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]], [
/(mitv-\w{5}) bui/i // Xiaomi
], [MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]], [
Expand Down
27 changes: 27 additions & 0 deletions test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,15 @@
"type": "smarttv"
}
},
{
"desc": "Sharp AQUOS-TVX19B",
"ua": "Mozilla/5.0 (Linux; Android 9; AQUOS-TVX19B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36",
"expect": {
"vendor": "Sharp",
"model": "AQUOS-TVX19B",
"type": "smarttv"
}
},
{
"desc": "Sharp Aquos B10",
"ua": "Mozilla/5.0 (Linux; Android 7.0; SH-A01) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Mobile Safari/537.36",
Expand Down Expand Up @@ -1890,6 +1899,24 @@
"type": "smarttv"
}
},
{
"desc": "Sony BRAVIA 4K GB ATV3",
"ua": "Mozilla/5.0 (Linux; Android 9; BRAVIA 4K GB ATV3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36",
"expect": {
"vendor": "Sony",
"model": "BRAVIA 4K GB ATV3",
"type": "smarttv"
}
},
{
"desc": "Sony Bravia 4k UR2",
"ua": "Mozilla/5.0 (Linux: Andr0id 9: BRAVIA 4K UR2 Build/PTT1.190515.001.S104) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36 OPR/46.0.2207.0 OMI/4.13.5.431.DIA5HBBTV.250 Model/Sony-BRAVIA-4K-UR2",
"expect": {
"vendor": "Sony",
"model": "BRAVIA 4K UR2",
"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 ea04d01

Please sign in to comment.