Skip to content

Fix cookieconsent2 false-positive blocking didomi opt-out on Evite#1323

Merged
muodov merged 2 commits intomainfrom
cursor/evite-website-popup-handling-fa2a
May 1, 2026
Merged

Fix cookieconsent2 false-positive blocking didomi opt-out on Evite#1323
muodov merged 2 commits intomainfrom
cursor/evite-website-popup-handling-fa2a

Conversation

@muodov
Copy link
Copy Markdown
Member

@muodov muodov commented Apr 30, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/1203268166580279/task/1214074223746047?focus=true

Description:

Fixes popup handling on evite.com event pages (and similar sites) where the cookie banner was not being dismissed.

Root cause

Evite ships the orestbida/cookieconsent v2 library globally and leaves its modal (#cc--main / #cm) in the DOM even when no banner is being shown. The modal element has style="visibility: hidden" and position: fixed, but autoconsent's internal isElementVisible helper treats any fixed-position element with display !== 'none' as visible — visibility: hidden is ignored. Combined with the previous cookieconsent2 rule's detectPopup: { "visible": "#cm" } step, the rule was matching on Evite even though no banner was open.

In US/CA regions this caused the rule to "win" the popup-detection race ahead of the real didomi banner and then fail at opt-out (#s-rall-bn doesn't exist). In FR it produced a Found multiple CMPs warning while didomi happened to also fire. In DE/GB the timing worked out so didomi handled it, but the false cookieconsent2 detection was still happening.

Fix

Detect the cookieconsent2 popup via html.show--consent #cm. The orestbida/cookieconsent v2 library (since v2.1) toggles the show--consent class on the <html> element to actually show the modal (CSS in the library applies visibility: visible !important based on this class). Using exists rather than visible avoids the fixed-position visibility quirk, and the class is the canonical signal that the banner is actually open.

The existing { "exists": "#s-all-bn" } step is preserved so the rule still confirms the accept button is mounted before attempting to interact.

Verification

Tested via BrightData remote browsers across geographic regions.

Before the fix:

  • de / gb: didomi opt-out worked but cookieconsent2 was incorrectly co-detected
  • fr: Found multiple CMPs warning (cookieconsent2 + didomi)
  • us-losangeles / ca: cookieconsent2 won the popup race → optOutResult: false (no #s-rall-bn), didomi never tried

After the fix:

  • de / gb / nl / us-newyork / us-losangeles / fr: only didomi detected, optOut: true, popup dismissed (no more multi-CMP warning)
  • ca: only didomi detected; popup handling now occasionally flaky because the didomi notice on Evite-CA appears at ~6s while autoconsent's waitForPopup retries for ~5s — this is a pre-existing engine timing issue independent of this rule fix, previously masked by the cookieconsent2 false-positive.

Smoke-tested the rule still works on real cookieconsent v2 sites (fashionnetwork.com, officeshoes.ro): optOut: true, autoconsentDone.

npm run build-rules, npm run rule-syntax-check, and npm run lint all pass.

Evite event page after autoconsent opt-out (FR region, popup gone):

Evite FR after fix

Evite DE after opt-out (didomi flow, full page rendered):

Evite DE after opt-out

Reference: didomi popup that needs to be opted out (CA region, no autoconsent):

Didomi popup on Evite CA

Steps to test this PR:

  1. Build the extension: npm run prepublish
  2. Load dist/addon-mv3/ as an unpacked extension in Chrome
  3. Open the reported Evite URL: https://www.evite.com/event/02B0IIAE4SKDAA5GCEPRGRRIX4OKRA?gid=008FIIAE4SKDAAWUOEPRG2GTQQBCKQ
  4. Verify the didomi banner is dismissed and the page is usable
  5. Verify the devtools console reports Found CMP: didomi and optOutResult: true (only one CMP, no Found multiple CMPs warning)
  6. Optionally retest in EU and US regions via VPN / BrightData to confirm no cookieconsent2 is co-detected
  7. Optionally verify on a real cookieconsent v2 site (e.g. fashionnetwork.com) that the rule still detects, opts out, and dismisses the banner

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

The cookieconsent2 rule used { "visible": "#cm" } to detect an open
popup, but the autoconsent visibility check treats fixed-position
elements as visible regardless of their CSS visibility property. On
Evite (and likely other sites) the orestbida/cookieconsent v2 modal
is initialized with style="visibility: hidden" and position:fixed
yet remains in the DOM even when no consent banner is being shown.
This caused the cookieconsent2 rule to falsely match and either
short-circuit detection of the real didomi popup or fail because
#s-rall-bn doesn't exist.

Switch to detecting the canonical "show--consent" class that
cookieconsent v2 (>=2.1) toggles on the html element when the modal
is actually open. This matches the library's own visibility logic
and avoids the visibility:hidden false-positive.

Co-authored-by: Maxim Tsoy <maks.tsoy@gmail.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 30, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@muodov muodov added the minor Increment the minor version when merged label Apr 30, 2026
@daxtheduck
Copy link
Copy Markdown
Collaborator

CI run finished. Artifacts ZIP for the review tool

@muodov muodov merged commit 1a231d9 into main May 1, 2026
6 checks passed
@muodov muodov deleted the cursor/evite-website-popup-handling-fa2a branch May 1, 2026 09:31
@daxtheduck
Copy link
Copy Markdown
Collaborator

CI run finished. Artifacts ZIP for the review tool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Increment the minor version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants