Skip to content

Cookie settings: explain when the consent tool is blocked - #45

Merged
fjp merged 2 commits into
masterfrom
cookie-settings-fallback
Oct 8, 2026
Merged

fjp merged 2 commits into
masterfrom
cookie-settings-fallback

Conversation

@fjp

@fjp fjp commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Why

Ad blockers and privacy extensions usually block Google's consent tool (fundingchoicesmessages.google.com). The footer's Cookie settings link only asks that tool to reopen its message, so in such browsers the link silently did nothing and looked broken. Franz noticed it in his normal browser; in incognito, without extensions, it worked.

What changes

The click handler still queues googlefc.showRevocationMessage(). If that callback hasn't run 2.5 seconds after the click, a small note appears at the bottom of the screen for 12 seconds:

Google's consent tool didn't load in this browser, probably because of an ad blocker or privacy extension. While it's blocked, Google Analytics doesn't load here and there's no consent to change.

The note doesn't claim that no ads load. A blocker might block only the consent tool, and outside Europe ads don't depend on consent. Analytics, though, never starts without the consent tool: the adapter waits for its callback.

Testing

Local build in Chromium:

  • With adsbygoogle.js blocked, the note appears.
  • With a stub consent tool, showRevocationMessage runs and no note appears.
  • No page errors in either case.

Ad blockers usually block Google's consent tool, so the Cookie settings
link silently did nothing. If the tool hasn't run 2.5 s after the
click, a short note says it's blocked, that Analytics doesn't load
then, and that there's no consent to change.
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-08 14:30 CEST

@github-actions
github-actions Bot temporarily deployed to pr-preview October 8, 2026 12:12 Destroyed
Codex review:
- if the consent tool answered after 2.5 s, the note stayed up although
  the settings opened; the callback now clears the timer and removes a
  shown note (and a flag covers callbacks that run inside push)
- 'there's no consent to change' was wrong for visitors with an earlier
  choice; the note now says the settings can't be opened here and that
  any earlier choice stays as it was
- the note uses calc(100vw - 2rem) up to 32rem, instead of half the
  screen width on phones
@github-actions
github-actions Bot temporarily deployed to pr-preview October 8, 2026 12:23 Destroyed
@fjp
fjp merged commit 908dca8 into master Oct 8, 2026
1 check passed
@fjp
fjp deleted the cookie-settings-fallback branch October 8, 2026 12:30
@fjp fjp added the enhancement New feature or request label Oct 14, 2026
@fjp fjp self-assigned this Oct 14, 2026

This branch was successfully deployed

No deployments
pr-preview — 670d19f7 Deployed Oct 8, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant