Skip to content

Commit

Permalink
[submodule:extensions] Add new CLI: ELinks, HTTPie
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Nov 14, 2024
1 parent ba980c8 commit 4a12562
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/extensions/ua-parser-extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const LIBRARY = 'library';

const CLIs = Object.freeze({
browser : [
// wget / curl / lynx
[/(wget|curl|lynx)[\/ ]([\w\.]+)/i], [NAME, VERSION, [TYPE, CLI]]
// wget / curl / Lynx / ELinks / HTTPie
[/(wget|curl|lynx|elinks|httpie)[\/ ]\(?([\w\.-]+)/i], [NAME, VERSION, [TYPE, CLI]]
]
});

Expand Down
2 changes: 1 addition & 1 deletion src/main/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@
// Other
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Obigo/Mosaic/Go/ICE/UP.Browser
/(links) \(([\w\.]+)/i // Links
/\b(links) \(([\w\.]+)/i // Links
], [NAME, [VERSION, /_/g, '.']], [

/(cobalt)\/([\w\.]+)/i // Cobalt
Expand Down
30 changes: 30 additions & 0 deletions test/specs/browser-clis.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,36 @@
"type" : "cli"
}
},
{
"desc" : "ELinks",
"ua" : "ELinks/0.11.4-3-lite (textmode; Debian; Linux 2.6.26-1-686 i686;",
"expect" :
{
"name" : "ELinks",
"version" : "0.11.4-3-lite",
"type" : "cli"
}
},
{
"desc" : "ELinks",
"ua" : "ELinks (0.11.3; Linux 2.6.23-hardened-r4 i686; 166x55)",
"expect" :
{
"name" : "ELinks",
"version" : "0.11.3",
"type" : "cli"
}
},
{
"desc" : "HTTPie",
"ua" : "HTTPie/0.9.9",
"expect" :
{
"name" : "HTTPie",
"version" : "0.9.9",
"type" : "cli"
}
},
{
"desc" : "lynx",
"ua" : "Lynx 2.8.8dev.3",
Expand Down

0 comments on commit 4a12562

Please sign in to comment.