WhichBrowser / Parser-PHP

Browser sniffing gone too far — A useragent parser library for PHP
http://whichbrowser.net
MIT License
1.81k stars 238 forks source link

Brave Browser - Incorrect detection of user agent string #658

Open alfreddagenais opened 3 years ago

alfreddagenais commented 3 years ago

I'm using Brave Browser version 1.25.72 Chromium: 91.0.4472.101 (Build officiel) (x86_64)

My agent string is : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36

On version 2.1 of WhichBrowser/Parser-PHP they show me : Chrome Dev 91.0.4472.101 on macOS Catalina 10.15 On version 2.1.2 of WhichBrowser/Parser-PHP they show me : an unknown browser

summercms commented 3 years ago

Brave had a User-Agent of its own in the first few months of its existence, but removed it in April 2016 . The history books (git commit logs) show that Brave removed the “Brave/Version” component from their User-Agent string to make it more difficult to fingerprint the browser.

On a positive note, you can now reliably detect Brave using the following test (as of 2020):

(navigator.brave && await navigator.brave.isBrave() || false)

We can detect Brave Browser using client hints ua, comes out like this:

Sec-CH-UA: Brave Browser 79

p.s. would love to see admins thoughts about detecting Brave browser.

Chasapple4 commented 2 years ago

Vivaldi masks as Chrome for similar reasons (many sites would block Vivaldi or send broken code if it was not Chrome)