Skip to content

Commit

Permalink
Fix #730 - Improve browser detection: DuckDuckGo
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed May 23, 2024
1 parent d0db40c commit e87c794
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,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, 'UCBrowser']], [
/microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser
Expand Down
10 changes: 10 additions & 0 deletions test/specs/browser-all.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 e87c794

Please sign in to comment.