It shouldn’t happen because that navigator.brave is only present in Brave.
I am not JS guru, I only use it as hobby but seems like reading the code, some stuff clearly seems like it could improved.
For example, what is the purpose of ‘detecting brave twice’ and then the two messages h3? you know the ones “Brave Browser not detected” and the other with “Operate Your Wallet&Node from Brave Browser” technically one would never be used because window.navigator.brave != undefined and window.navigator.brave.isBrave.name == "isBrave" will always co-exist and be true when using Brave. There is no way Brave will be != undefined and then ==isBrave will be false or that’s what I have seen.
In that case wouldn’t if (window.navigator.brave != undefined && window.navigator.brave.isBrave.name == "isBrave") be better?
That means the logic for the messages is kind of more complicated than it should be, since one of the else would never happen and one h3 message would be displayed if the person is not using Brave.
BTW, you can test Brave without the API, if you use example##+js(brave-fix) in brave://adblock as custom rule, which will make it easy to remove the API with the simple scriptlet Brave created and then you can test it inside Brave too, how would it work without it. you can also add all your website domains like example1,example2 and that rule would apply to all of them in case you want to test them without it and not just in another browser.
Like I said, I am not coder, just learned it because I like to learn, especially when I started making my own scriptlet injections for the adblocker. But I am not like the person who would say any code or anything, just say what I think when I read the code and how Brave seems to work.
Anyway, hope something I said can be helpful! Take care.
Well yes, technically that’s why you made the scriptlet for, but it can help for this, because for example, I tested the code in codepen, and I only needed to add cdpn.io##+js(brave-fix) and done, any change would reload the iframe which means I could quickly see it working without switching browsers, which in my case was not needed.
So only because it was made for that purpose doesn’t restrict users from doing it for something else, like testing the other way, to see if it is blocking correctly the site when not using Brave, instead of removing the block.
This is already available for any Brave user, but to be honest, I am already able to use any scriptlet inside Brave, like how I took the ‘set-cookies’ pes10k was converting from Adguard which was all restricted because of ‘security’ and I removed all the restrictions and now I can set whatever it’s needed.
What happened to that? is it going to be released and used someday? because I only saw it in adblock-resources and being approved and merged but notwhere else, only mention of it it’s the Fanboy annoyances list at the bottom which you added, and while I don’t need it, seems like a cool scriptlet to have available for Brave lists when needed.
Being creative and breaking rules or ‘hack it’ is better and less boring, than just use things as they were meant to be.
Now that finally found the perfect way to detect if a user is using Brave, i will simply do the other way around, and restrict the users to use our websites from BRAVE.
I brought them here, i will move them from here.
R.I.P Grave Browser.