Skip to content

Commit bf5155e

Browse files
committed
Add new vendor: Philips
1 parent ecbc033 commit bf5155e

File tree

5 files changed

+92
-42
lines changed

5 files changed

+92
-42
lines changed

src/enums/ua-parser-enums.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ export const Vendor: Readonly<{
243243
PALM: "Palm";
244244
PANASONIC: "Panasonic";
245245
PEBBLE: "Pebble";
246+
PHILIPS: "Philips";
246247
PICO: "Pico";
247248
POLYTRON: "Polytron";
248249
REALME: "Realme";

src/enums/ua-parser-enums.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ const Vendor = Object.freeze({
254254
PALM: 'Palm',
255255
PANASONIC: 'Panasonic',
256256
PEBBLE: 'Pebble',
257+
PHILIPS: 'Philips',
257258
PICO: 'Pico',
258259
POLYTRON: 'Polytron',
259260
REALME: 'Realme',

src/main/ua-parser.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,8 @@
772772
/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i, // BLU/HMD/IMO/Infinix/Lava/OnePlus/TCL
773773
/(hp) ([\w ]+\w)/i, // HP iPAQ
774774
/(microsoft); (lumia[\w ]+)/i, // Microsoft Lumia
775-
/(oppo) ?([\w ]+) bui/i // OPPO
775+
/(oppo) ?([\w ]+) bui/i, // OPPO
776+
/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i // Philips
776777
], [VENDOR, MODEL, [TYPE, MOBILE]], [
777778

778779
/(kobo)\s(ereader|touch)/i, // Kobo
@@ -799,6 +800,7 @@
799800
// SMARTTVS
800801
///////////////////
801802

803+
/(philips)[\w ]+tv/i, // Philips
802804
/smart-tv.+(samsung)/i // Samsung
803805
], [VENDOR, [TYPE, SMARTTV]], [
804806
/hbbtv.+maple;(\d+)/i
@@ -836,11 +838,6 @@
836838
/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, // Roku
837839
/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i // HbbTV devices
838840
], [[VENDOR, /.+\/(\w+)/, '$1', strMapper, {'LG':'lge'}], [MODEL, trim], [TYPE, SMARTTV]], [
839-
// SmartTV from Unidentified Vendors
840-
/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i
841-
], [MODEL, [TYPE, SMARTTV]], [
842-
/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i
843-
], [[TYPE, SMARTTV]], [
844841

845842
///////////////////
846843
// CONSOLES
@@ -911,6 +908,10 @@
911908
// MIXED (GENERIC)
912909
///////////////////
913910

911+
/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i // Unidentifiable SmartTV
912+
], [MODEL, [TYPE, SMARTTV]], [
913+
/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i
914+
], [[TYPE, SMARTTV]], [
914915
/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i
915916
], [MODEL, [TYPE, strMapper, { 'mobile' : 'Mobile', 'xr' : 'VR', '*' : TABLET }]], [
916917
/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i // Unidentifiable Tablet

test/data/ua/device/_others.json

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -122,42 +122,6 @@
122122
"type": "undefined"
123123
}
124124
},
125-
{
126-
"desc": "Philips SmartTV",
127-
"ua": "Opera/9.80 HbbTV/1.1.1 (; Philips; ; ; ; ) NETTV/4.0.2; en) Version/11.60",
128-
"expect": {
129-
"vendor": "Philips",
130-
"model": "",
131-
"type": "smarttv"
132-
}
133-
},
134-
{
135-
"desc": "Philips 32PFL6606K/02 SmartTV (2011)",
136-
"ua": "Opera/9.80 (Linux mips ; U; HbbTV/1.1.1 (; Philips; ; ; ; ) CE-HTML/1.0 NETTV/3.1.0; en) Presto/2.6.33 Version/10.70",
137-
"expect": {
138-
"vendor": "Philips",
139-
"model": "",
140-
"type": "smarttv"
141-
}
142-
},
143-
{
144-
"desc": "Philips 32PFL6606K/02 SmartTV (2013)",
145-
"ua": "Opera/9.80 (Linux mips ; U; HbbTV/1.1.1 (; Philips; ; ; ; ) CE-HTML/1.0 NETTV/3.1.0; en) Presto/2.6.33 Version/10.70",
146-
"expect": {
147-
"vendor": "Philips",
148-
"model": "",
149-
"type": "smarttv"
150-
}
151-
},
152-
{
153-
"desc": "Philips 32PHS5301/12 SmartTV (2016)",
154-
"ua": "Mozilla/5.0 (Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36 OPR/29.0.1803.0 OMI/4.5.23.37.MOT2.13 HbbTV/1.2.1 (;Philips;32PHS5301/12;;_TV_MT5800;) Firmware/TPM161E_012.002.045.001 en",
155-
"expect": {
156-
"vendor": "Philips",
157-
"model": "32PHS5301/12",
158-
"type": "smarttv"
159-
}
160-
},
161125
{
162126
"desc": "Samsung SmartTV",
163127
"ua": "Mozilla/5.0 (SMART-TV; X11; Linux armv7l) AppleWebkit/537.42 (KHTML, like Gecko) Safari/537.42",

test/data/ua/device/philips.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
[
2+
{
3+
"desc": "Philips S616",
4+
"ua": "Mozilla/5.0 (Linux; Android 5.1; Philips S616 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Mobile Safari/537.36",
5+
"expect": {
6+
"vendor": "Philips",
7+
"model": "S616",
8+
"type": "mobile"
9+
}
10+
},
11+
{
12+
"desc": "Philips W8510",
13+
"ua": "Mozilla/5.0 (Linux; Android 4.2.2; Philips W8510 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.68 Mobile Safari/537.36",
14+
"expect": {
15+
"vendor": "Philips",
16+
"model": "W8510",
17+
"type": "mobile"
18+
}
19+
},
20+
{
21+
"desc": "Philips SmartTV",
22+
"ua": "Mozilla/5.0 (Linux; Android 11; PHILIPS 4k TV Build/RTXC.231010.082.A1; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/126.0.6478.71 Mobile Safari/537.36",
23+
"expect": {
24+
"vendor": "PHILIPS",
25+
"model": "undefined",
26+
"type": "smarttv"
27+
}
28+
},
29+
{
30+
"desc": "Philips SmartTV",
31+
"ua": "Opera/9.80 HbbTV/1.1.1 (; Philips; ; ; ; ) NETTV/4.0.2; en) Version/11.60",
32+
"expect": {
33+
"vendor": "Philips",
34+
"model": "",
35+
"type": "smarttv"
36+
}
37+
},
38+
{
39+
"desc": "Philips 32PFL6606K/02 SmartTV (2011)",
40+
"ua": "Opera/9.80 (Linux mips ; U; HbbTV/1.1.1 (; Philips; ; ; ; ) CE-HTML/1.0 NETTV/3.1.0; en) Presto/2.6.33 Version/10.70",
41+
"expect": {
42+
"vendor": "Philips",
43+
"model": "",
44+
"type": "smarttv"
45+
}
46+
},
47+
{
48+
"desc": "Philips 32PFL6606K/02 SmartTV (2013)",
49+
"ua": "Opera/9.80 (Linux mips ; U; HbbTV/1.1.1 (; Philips; ; ; ; ) CE-HTML/1.0 NETTV/3.1.0; en) Presto/2.6.33 Version/10.70",
50+
"expect": {
51+
"vendor": "Philips",
52+
"model": "",
53+
"type": "smarttv"
54+
}
55+
},
56+
{
57+
"desc": "Philips 32PHS5301/12 SmartTV (2016)",
58+
"ua": "Mozilla/5.0 (Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36 OPR/29.0.1803.0 OMI/4.5.23.37.MOT2.13 HbbTV/1.2.1 (;Philips;32PHS5301/12;;_TV_MT5800;) Firmware/TPM161E_012.002.045.001 en",
59+
"expect": {
60+
"vendor": "Philips",
61+
"model": "32PHS5301/12",
62+
"type": "smarttv"
63+
}
64+
},
65+
{
66+
"desc": "Philips PH0M_EA_T32",
67+
"ua": "Mozilla/5.0 (Linux; Android 10; Philips FHD Android TV Build/QTG3.201102.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.186 Mobile Safari/537.36",
68+
"expect": {
69+
"vendor": "Philips",
70+
"model": "undefined",
71+
"type": "smarttv"
72+
}
73+
},
74+
{
75+
"desc": "Philips PH3M_AL_T32",
76+
"ua": "Mozilla/5.0 (Linux; Android 11; Philips Google TV TA7 Build/RTM5.220609.199; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/111.0.5563.58 Mobile Safari/537.36",
77+
"expect": {
78+
"vendor": "Philips",
79+
"model": "undefined",
80+
"type": "smarttv"
81+
}
82+
}
83+
]

0 commit comments

Comments
 (0)