Skip to content

feat(blocker): refuse cookie consent, never accept it - #331

Merged
Alexays merged 2 commits into
mainfrom
feat/refuse-cookie-consent
Nov 7, 2026
Merged

Alexays merged 2 commits into
mainfrom
feat/refuse-cookie-consent

Conversation

@Alexays

@Alexays Alexays commented Nov 7, 2026

Copy link
Copy Markdown
Owner

What

The built-in blocker no longer accepts cookie consent on the user's behalf, and refuses it where the page's consent platform has a documented API.

Never accept (list conversion)

The cookie-notice lists Lilo enables by default carry trusted-click-element rules that click accept buttons (#didomi-notice-agree-button on hundreds of sites, OneTrust, Cookiebot, Sourcepoint sp_choice_type_11, Quantcast mode="primary"...) and set-cookie / storage-item rules that store an accepted answer. Accepting then loads the site's ad and tracker stack.

FilterListConverter.acceptsConsent drops such a rule at conversion, generically, from the rule's own arguments:

  • a click: its target (the selector's last compound) names no refusal, and the selector names an accept/agree/allow answer (word stems in the lists' languages, camelCase and punctuation split), or excludes the reject button with :not(). Refusal words (reject, necessary only, continue without, revoke, select...) win over accept words, so "accept only necessary" is kept. A sequence is dropped when any step accepts.
  • a stored answer: the value names an accept answer, or is truthy under a key that does, or is a saved consent record (an id or TCF string under a consent key) whose answer cannot be read; refusals, falsy values and empty lists are kept.

On the default lists (uBO filters, EasyList, EasyPrivacy, uBO privacy and badware, liste_fr, EasyList Cookie, uBO cookie annoyances, fetched 2026-11-07):

accept (dropped) reject / necessary / without neutral (close, settings, OK)
trusted-click-element 222 373 317
set-cookie / storage items 503 (57 of them saved consent records) 1687 1656

The lists' hiding and scroll-unlock rules stay, so the banner stays hidden; it is just never answered with accept.

Refuse (refuse-consent scriptlet)

While the cookie-notice lists are on, every site runs a refuse-consent scriptlet (a * entry of the scriptlet table, so it stands down with the blocker, for a paused site, and for a site's #@#+js()). In the top document only, it waits on each platform's own ready signal and refuses only while the visitor has not answered:

Platform Ready signal Refusal Source
OneTrust OneTrustGroupsUpdated window event OneTrust.IsAlertBoxClosed() false: OneTrust.RejectAll() developer.onetrust.com Web CMP JavaScript API, Events Guide
Cookiebot CookiebotOnDialogDisplay window event Cookiebot.hasResponse false: submitCustomConsent(false, false, false), hide() cookiebot.com/en/developer
Usercentrics v3 / v2 UC_UI_INITIALIZED window event isConsentRequired(): denyAllConsents(), then closeCmp() / closeCMP() usercentrics.com/docs/web/features/api/control-functionality, docs.usercentrics.com cmp-v2-ui-api
Didomi its script's load (a capture listener on load), then didomiOnReady shouldUserStatusBeCollected(): setUserDisagreeToAll() developers.didomi.io/cmp/web-sdk/reference/api

Sourcepoint, Quantcast Choice, TrustArc and Axeptio document no reject-all call (the TCF __tcfapi has none either): they are left to the lists' hiding and reject clicks.

Nothing polls and nothing runs at idle: three window listeners and a capture load listener that reads one property per loaded resource until Didomi appears. Nothing is added to the page: no global, the Didomi callback is bound so it prints as native code, and PageWorldTests now runs the scriptlet.

Bench

make page-bench ROUNDS=12 (#329, not part of this PR), tables converted from the same list texts before and after. Lilo tab minus plain web view, medians, up to the load event:

Site load ms before / after CPU ms before / after requests before / after consent before / after
leboncoin.fr -500 / -376 -522 / -557 -56 / -90 refused / refused (Didomi)
leparisien.fr +44 / +6 +33 / +37 -2 / -8 accepted (11 purposes, 247 vendors) / refused (Didomi)
allocine.fr +44 / +216 +18 / +96 -9 / +6 accepted (11 purposes, 951 vendors) / refused (Didomi)
dailymail.co.uk -89 / -124 -49 / +1 -23 / -13 no TCF answer / no TCF answer
lemonde.fr +72 / +43 +107 / +107 -4 / -4 no CMP API seen / same
lefigaro.fr -379 / -334 -505 / -551 -26 / -23 accepted (11 purposes, 236 vendors) / unanswered (AppConsent, 0 consents)
20minutes.fr -206 / -232 -175 / -172 -16 / -16 no TCF answer / same

Consent read from the page after load (Didomi getCurrentUserStatus, __tcfapi getTCData). Every page stays scrollable (no overflow: hidden on html or body). The bench stops at the load event, so it misses most of what an accept loads afterwards; allocine's rise is its Dailymotion player frame, which now starts before the load event once consent is answered early, where the accept click came after it.

Tests

  • FilterListConverterTests.testConsentIsNeverAcceptedOnTheUsersBehalf: accept clicks and stored acceptances dropped, rejects, necessary-only, continue-without, close and opaque values kept.
  • BlockerLayersTests.testConsentIsRefusedNeverAccepted: through FilterListService into a tab on a made-up example.com page with a fake OneTrust: the accept click is gone, the reject click runs, the platform is refused; with cookie notices shown, it is not.
  • PageWorldTests: the refuse-consent scriptlet leaves no trace.
  • scriptlets.test.ts: each platform, answered visitors left alone, subframes and paused sites.

Filter-list rules that answer a consent prompt with accept on the user's
behalf are dropped at conversion: trusted-click-element rules whose target
names an accept, agree or allow control (in the lists' languages, or a
consent platform's accept button), set-cookie and storage-item rules that
store an accepted answer, and those restoring a saved consent record (an id
or TCF string) whose answer cannot be read. Rules that reject, keep
necessary only, continue without accepting or close stay, as do the lists'
hiding and scroll unlock.

While cookie notices are hidden, every site also runs a refuse-consent
scriptlet that answers the consent platform the page loads through its
documented API, only while the visitor has not answered: OneTrust
RejectAll on OneTrustGroupsUpdated, Cookiebot submitCustomConsent on
CookiebotOnDialogDisplay, Usercentrics v3/v2 denyAllConsents on
UC_UI_INITIALIZED, and Didomi setUserDisagreeToAll through its ready queue
once its script has loaded. It stands down with the blocker, for a paused
site, and in subframes.
@Alexays
Alexays merged commit 0f48cea into main Nov 7, 2026
12 of 13 checks passed
@Alexays
Alexays deleted the feat/refuse-cookie-consent branch November 7, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant