Skip to content

Commit a6c85d0

Browse files
committed
Add new engine: LibWeb + Add new OS: SerenityOS
1 parent 7a4fe6f commit a6c85d0

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

src/ua-parser-enum.js

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ const EngineName = Object.freeze({
6868
GECKO : 'Gecko',
6969
GOANNA : 'Goanna',
7070
ICAB : 'iCab',
71+
LIBWEB : 'LibWeb',
7172
KHTML : 'KHTML',
7273
LINKS : 'Links',
7374
LYNX : 'Lynx',

src/ua-parser.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,8 @@
771771
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
772772
/ekioh(flow)\/([\w\.]+)/i, // Flow
773773
/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links
774-
/(icab)[\/ ]([23]\.[\d\.]+)/i // iCab
774+
/(icab)[\/ ]([23]\.[\d\.]+)/i, // iCab
775+
/\b(libweb)/i
775776
], [NAME, VERSION], [
776777

777778
/rv\:([\w\.]{1,9})\b.+(gecko)/i // Gecko
@@ -849,7 +850,7 @@
849850
], [[NAME, 'Solaris'], VERSION], [
850851
/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, // Solaris
851852
/(aix) ((\d)(?=\.|\)| )[\w\.])*/i, // AIX
852-
/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX
853+
/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS
853854
/(unix) ?([\w\.]*)/i // UNIX
854855
], [NAME, VERSION]
855856
]

test/engine-test.json

+9
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@
5353
"version" : "4.5.4"
5454
}
5555
},
56+
{
57+
"desc" : "LibWeb",
58+
"ua" : "Mozilla/4.0 (SerenityOS; x86) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb",
59+
"expect" :
60+
{
61+
"name" : "LibWeb",
62+
"version" : "undefined"
63+
}
64+
},
5665
{
5766
"desc" : "NetFront",
5867
"ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0",

test/os-test.json

+9
Original file line numberDiff line numberDiff line change
@@ -1204,5 +1204,14 @@
12041204
"name" : "Linspire",
12051205
"version" : "1.5.0.4"
12061206
}
1207+
},
1208+
{
1209+
"desc" : "SerenityOS",
1210+
"ua" : "Mozilla/4.0 (SerenityOS; x86) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb",
1211+
"expect" :
1212+
{
1213+
"name" : "SerenityOS",
1214+
"version" : "undefined"
1215+
}
12071216
}
12081217
]

0 commit comments

Comments
 (0)