Skip to content

Commit e7bfc4e

Browse files
committed
Backport - Fix #730 - Improve browser detection: DuckDuckGo
(cherry picked from commit e87c794)
1 parent 775de4e commit e7bfc4e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/ua-parser.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@
243243
/(heytap|ovi)browser\/([\d\.]+)/i, // Heytap/Ovi
244244
/(weibo)__([\d\.]+)/i // Weibo
245245
], [NAME, VERSION], [
246+
/\bddg\/([\w\.]+)/i // DuckDuckGo
247+
], [VERSION, [NAME, 'DuckDuckGo']], [
246248
/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser
247249
], [VERSION, [NAME, 'UC'+BROWSER]], [
248250
/microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser

test/browser-test.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,16 @@
419419
"major" : "1"
420420
}
421421
},
422+
{
423+
"desc" : "DuckDuckGo",
424+
"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",
425+
"expect" :
426+
{
427+
"name" : "DuckDuckGo",
428+
"version" : "17.4.1",
429+
"major" : "17"
430+
}
431+
},
422432
{
423433
"desc" : "DuckDuckGo",
424434
"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",

0 commit comments

Comments
 (0)