Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I tell if a user is using Brave as their browser?

I have been messing around with the Brave browser (https://www.brave.com/), an I cannot figure out how to determine how if a user is using Brave. I used a simple document to output the user agent:

<script>document.write(navigator.userAgent);</script>

and I get:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.108 Safari/537.36

which doesn't really help me in my situation. Does anyone know how to determine anyone using Brave in PHP or JavaScript? Thanks!

like image 768
CrazyMatt Avatar asked Sep 01 '25 00:09

CrazyMatt


1 Answers

As of April 2020, you can use this detection method to get a boolean answer to whether the user is using Brave or not:

(navigator.brave && await navigator.brave.isBrave() || false)
like image 54
Daniel Avatar answered Sep 02 '25 15:09

Daniel