Skip to content

Commit 9057a1d

Browse files
committed
Backport - Add new browser: Ladybird
https://ladybird.org/ (cherry picked from commit 592bfdd)
1 parent 1d59e1a commit 9057a1d

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

src/ua-parser.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,9 @@
364364
/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, // Mozilla
365365

366366
// Other
367-
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
368-
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Obigo/Mosaic/Go/ICE/UP.Browser
369-
/(links) \(([\w\.]+)/i // Links
367+
/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
368+
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Obigo/Mosaic/Go/ICE/UP.Browser/Ladybird
369+
/\b(links) \(([\w\.]+)/i // Links
370370
], [NAME, [VERSION, /_/g, '.']], [
371371

372372
/(cobalt)\/([\w\.]+)/i // Cobalt
@@ -804,8 +804,11 @@
804804
/ekioh(flow)\/([\w\.]+)/i, // Flow
805805
/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links
806806
/(icab)[\/ ]([23]\.[\d\.]+)/i, // iCab
807-
/\b(libweb)/i
807+
808+
/\b(libweb)/i // LibWeb
808809
], [NAME, VERSION], [
810+
/ladybird\//i
811+
], [[NAME, 'LibWeb']], [
809812

810813
/rv\:([\w\.]{1,9})\b.+(gecko)/i // Gecko
811814
], [VERSION, NAME]

test/browser-test.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,16 @@
10581058
"major" : "91"
10591059
}
10601060
},
1061+
{
1062+
"desc" : "Ladybird",
1063+
"ua" : "Mozilla/5.0 (Linux; x86_64) Ladybird/1.0",
1064+
"expect" :
1065+
{
1066+
"name" : "Ladybird",
1067+
"version" : "1.0",
1068+
"major" : "1"
1069+
}
1070+
},
10611071
{
10621072
"desc" : "LibreWolf",
10631073
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0 LibreWolf/97.0.1",

test/engine-test.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@
6262
"version" : "4.5.4"
6363
}
6464
},
65+
{
66+
"desc" : "LibWeb",
67+
"ua" : "Mozilla/5.0 (Linux; x86_64) Ladybird/1.0",
68+
"expect" :
69+
{
70+
"name" : "LibWeb",
71+
"version" : "undefined"
72+
}
73+
},
6574
{
6675
"desc" : "LibWeb",
6776
"ua" : "Mozilla/4.0 (SerenityOS; x86) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb",

0 commit comments

Comments
 (0)