brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.75k stars 2.32k forks source link

Is the word "cookie" blocked from appearing in html markup? #34091

Closed dMaisnam closed 11 months ago

dMaisnam commented 11 months ago

Hey guys. So I was developing this website and after deploying it, I was accessing the site with Brave browser and found it strange that my cookies policy section was missing from the UI but present in the page source. It worked fine with other browsers which led me to assume this must be related to Brave's cookie blocker.

The section has an id cookie-policy but when I tried renaming it to something like _cookie-policy, it appeared. Is this the only workaround to this? Is this the intended behavior?

With id cookie-policy brave-cookie-policy

With id _cookie-policy brave-cookie

Brave version: Version 1.60.110 Chromium: 119.0.6045.105 (Official Build) (64-bit)

Thanks for reading.

ghost commented 11 months ago

This is what Brave does with the EasyCookie list and the adblocker. The cookie-policy ID is hidden by this rule: https://github.com/easylist/easylist/blob/ddd931049813a72c1ffb76582e5b49cd223a2b4c/easylist_cookie/easylist_cookie_general_hide.txt#L16639

That's how adblockers work, they are not magical, they just do whatever a rule says. In this case it is looking for the ID cookie-policy, you change it it will not be hidden, it is meant for cookie policies that popup when you open websites though, so change the name I guess.

So the 'only workaround' doesn't make sense, you can name it whatever you want, just not 'ads' or 'cookie-policy' or something that it is meant for something else when you can just name it 'cookie-policy-about' or something like that, just don't use something that can get hidden by the EasyCookie list or any other default list, Easylist can at least be disabled.

dMaisnam commented 11 months ago

Ok got it. Thanks for clearing my doubt.