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 simp
Brave has a class Brave
, which is created and added to navigator as navigator.brave
upon page load. It has one method which returns a promise: Brave.prototype.isBrave()
Using these three you can create a check for brave browser (something like this):
var isBrave = false;
if(window.Brave&&navigator.brave&&navigator.brave.isBrave){
isBrave = 'probable';//or some other value, as you wish
navigator.brave.isBrave().then(function(r){
if(r)isBrave = true;
});
}