ghostery / broken-page-reports

8 stars 4 forks source link

zichtadviseurs.nl #358

Closed philipp-classen closed 11 months ago

philipp-classen commented 11 months ago

Ghostery leaves a part of the consent dialog visible (should be hidden). URL: https://www.zichtadviseurs.nl

Screenshot 2023-09-21 at 18-18-35 Gelukkig geregeld bij Zicht adviseurs

philipp-classen commented 11 months ago

Turns out to be surprisingly tricky to fix, since it goes deep into the (mostly accidental) interaction between pattern visualization, selective blocking/unblocking and the adblocker engine. Without code changes and a full extension, I found no trick to get it working (only remove patterns from trackerdb, but that disables visualization and selective blocking/unblocking and can also not be limited to specific pages).

Disabling selective blocking/unblocking (removing that here https://github.com/ghostery/ghostery-extension/blob/1a8590af402817dc9fa36dc90c262f3729b43695/extension-manifest-v2/src/classes/EventHandlers.js#L314) would fix it. However, that breaks the UI since enabling/disabling categorizes or patterns will not have any effect.

I feel the only real solution would be to implement exclusion rules that can overrule the visualization layer.

philipp-classen commented 11 months ago

Essentially, it is a variant of the following (open) problem here: https://github.com/ghostery/broken-page-reports/issues/352 (and the experiment https://github.com/ghostery/trackerdb/pull/70 which is pending, since it requires an extension release).

philipp-classen commented 11 months ago

Found some workaround here. Instead of trying to hide the cookiebanner element directly (###cookiebanner), it appears to work to over-specify it (###cookiebanner[name=cookiebanner]):

COMMON.modules.adblocker.background.adblocker.manager.engine.updateFromDiff({ added: ['###cookiebanner[name=cookiebanner]'] })
philipp-classen commented 11 months ago

Should work with the latest update of the blocklists.