Skip to content

Commit

Permalink
Backport - Add new engine: LibWeb + Add new OS: SerenityOS
Browse files Browse the repository at this point in the history
(cherry picked from commit a6c85d0)
  • Loading branch information
faisalman committed Mar 31, 2023
1 parent 3f8b5ba commit bf9ac43
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,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 @@ -775,7 +776,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 bf9ac43

Please sign in to comment.