Cookie banner hiding code should allow multiple nodes to be hidden
Categories
(Core :: Privacy: Anti-Tracking, enhancement, P5)
Tracking
()
People
(Reporter: jhirsch, Unassigned)
References
(Blocks 1 open bug)
Details
The cookie banner hiding code assumes there is one root element to be hidden.
However, some websites (see [1] for example) have two nodes: one for an overlay, one for the cookie banner itself. Just hiding the banner can leave a darkened empty overlay, which is a broken user experience.
To handle these cases, it would be good to loosen the rules schema and modify the element hiding code code to allow multiple nodes to be hidden in one pass.
One approach might be to allow multiple CSS selectors in a single string, then pass that compound selector into querySelectorAll
, instead of querySelector
, then just hide however many nodes are returned.
[1] https://github.com/mozilla/cookie-banner-rules-list/issues/24
Reporter | ||
Comment 1•3 years ago
|
||
Hmm. Not sure if this should block the site metabug or the parent metabug...
Updated•3 years ago
|
Comment 2•3 years ago
|
||
Same thing here, it would be helpful to be able to hide multiple elements: https://github.com/mozilla/cookie-banner-rules-list/pull/106
Reporter | ||
Comment 3•2 years ago
|
||
It looks like https://github.com/mozilla/cookie-banner-rules-list/pull/106 has landed, so should we mark this issue as resolved?
Comment 4•2 years ago
|
||
No, I think this capability could still be helpful. I'm not aware of a case where we currently need it but lets keep this bug.
To support this we could change this call https://searchfox.org/mozilla-central/rev/2f9a79d1c4ae7090cf50d93be86ba9dc2767a733/toolkit/components/cookiebanners/CookieBannerChild.jsm#644 to querySelectorAll
like you mentioned above.
Description
•