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 the same user agent as Chrome. But Chrome itself add a lot (1768 as for now) of chrome-specific properties to window object. One of them is window.google. So detecting Brave is pretty simple (as for now):
const ua = window.navigator.userAgent.toLowerCase();
const isChrome = /chrome|crios/.test(ua) && ! /edge|opr\//.test(ua)
const isBrave = isChrome && ! window.google;
So brave, lol.