A brave appears, has several different objects in the window object. I'm not sure how adjacent they are in different versions of Brave, but I noticed two in the window.navigator object that are not displayed: plugins and mimeTypes. Since Brave is intended to be used as a browser for privacy, I think that they are likely to remain empty. So I will check to check their length.
Please note that you also need to first check if the browser is a desktop; You may not be able to detect the Brave Mobile browser; and the code below will pick up many mobile browsers
var agent = navigator.userAgent.toLowerCase(); var isChrome = /chrome|crios/.test(agent) && ! /edge|opr\//.test(agent); var isBrave = isChrome && window.navigator.plugins.length === 0 && window.navigator.mimeTypes.length === 0; if(isBrave) console.log( isBrave );
If you search in DuckDuckGo [which is my user agent], they will return Brave. If you open the JS file attachments, you will find complex browser detection that Brave can detect.
source share