Skip to content

Commit

Permalink
Backport - Fix #730 - Improve browser detection: DuckDuckGo
Browse files Browse the repository at this point in the history
(cherry picked from commit e87c794)
  • Loading branch information
faisalman committed May 28, 2024
1 parent 775de4e commit e7bfc4e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@
/(heytap|ovi)browser\/([\d\.]+)/i, // Heytap/Ovi
/(weibo)__([\d\.]+)/i // Weibo
], [NAME, VERSION], [
/\bddg\/([\w\.]+)/i // DuckDuckGo
], [VERSION, [NAME, 'DuckDuckGo']], [
/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser
], [VERSION, [NAME, 'UC'+BROWSER]], [
/microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser
Expand Down
10 changes: 10 additions & 0 deletions test/browser-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,16 @@
"major" : "1"
}
},
{
"desc" : "DuckDuckGo",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Safari/605.1.1517.4.1 Ddg/17.4.1",
"expect" :
{
"name" : "DuckDuckGo",
"version" : "17.4.1",
"major" : "17"
}
},
{
"desc" : "DuckDuckGo",
"ua" : "Mozilla/5.0 (Linux; Android 8.1.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/92.0.4515.131 Mobile DuckDuckGo/5 Safari/537.36",
Expand Down

0 comments on commit e7bfc4e

Please sign in to comment.