Skip to content

Commit

Permalink
Add new engine: LibWeb + Add new OS: SerenityOS
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Mar 28, 2023
1 parent 7a4fe6f commit a6c85d0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/ua-parser-enum.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const EngineName = Object.freeze({
GECKO : 'Gecko',
GOANNA : 'Goanna',
ICAB : 'iCab',
LIBWEB : 'LibWeb',
KHTML : 'KHTML',
LINKS : 'Links',
LYNX : 'Lynx',
Expand Down
5 changes: 3 additions & 2 deletions src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,8 @@
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
/ekioh(flow)\/([\w\.]+)/i, // Flow
/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links
/(icab)[\/ ]([23]\.[\d\.]+)/i // iCab
/(icab)[\/ ]([23]\.[\d\.]+)/i, // iCab
/\b(libweb)/i
], [NAME, VERSION], [

/rv\:([\w\.]{1,9})\b.+(gecko)/i // Gecko
Expand Down Expand Up @@ -849,7 +850,7 @@
], [[NAME, 'Solaris'], VERSION], [
/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, // Solaris
/(aix) ((\d)(?=\.|\)| )[\w\.])*/i, // AIX
/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX
/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS
/(unix) ?([\w\.]*)/i // UNIX
], [NAME, VERSION]
]
Expand Down
9 changes: 9 additions & 0 deletions test/engine-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@
"version" : "4.5.4"
}
},
{
"desc" : "LibWeb",
"ua" : "Mozilla/4.0 (SerenityOS; x86) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb",
"expect" :
{
"name" : "LibWeb",
"version" : "undefined"
}
},
{
"desc" : "NetFront",
"ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0",
Expand Down
9 changes: 9 additions & 0 deletions test/os-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1204,5 +1204,14 @@
"name" : "Linspire",
"version" : "1.5.0.4"
}
},
{
"desc" : "SerenityOS",
"ua" : "Mozilla/4.0 (SerenityOS; x86) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb",
"expect" :
{
"name" : "SerenityOS",
"version" : "undefined"
}
}
]

0 comments on commit a6c85d0

Please sign in to comment.