Closed Bug 1857838 Opened 2 years ago Closed 2 years ago

cookie banner service causes webpage to keep reloading

Categories

(Core :: Privacy: Anti-Tracking, defect, P1)

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox-esr115 --- unaffected
firefox118 --- unaffected
firefox119 --- unaffected
firefox120 --- unaffected
firefox121 --- affected

People

(Reporter: felix.bau, Assigned: abhishekmadan)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/120.0

Steps to reproduce:

Enable the feature that auto clicks cookie banners.
Surf to https://www.comedycentral.tv/

Actual results:

It keeps on reloading the page.
Everytime it finishes loading, the page get's reloaded (probably due to the cookie related action being repeated over and over again)

Expected results:

The cookie settings should only be set once.
The page permanently shows a button in the bottom left corner that doesn't go away. Which causes the new feature to think that there are further cookies to disable I assume. (even though there aren't)

See webcompat:
https://github.com/webcompat/web-bugs/issues/128165

Component: Untriaged → Privacy: Anti-Tracking
OS: Unspecified → All
Product: Firefox → Core
Hardware: Unspecified → All
Version: Firefox 120 → Trunk

Current beta (119.0b6) is not affected even though it boosts the feature.
The bug only occurs in Nightly.

I just did some regression testing and found the commit introducing it
2023-10-09T03:46:14.334000: DEBUG : Found commit message:
Bug 1820793 - Enable global cookie banner handling rules in Nightly. r=timhuang

Differential Revision: https://phabricator.services.mozilla.com/D187977

2023-10-09T03:46:14.334000: DEBUG : Did not find a branch, checking all integration branches
2023-10-09T03:46:14.335000: INFO : The bisection is done.
2023-10-09T03:46:14.336000: INFO : Stopped

:pbz Sorry to bother you Paul, maybe you could take a look :)

During regression testing I discovered, that the bug often doesn't trigger on the first page load.
First page load (no cookies on load)
Reload to reject cookies (banner)
nothing happens
but every consecutive reload from now on triggers endless pagereloads
(during a few runs I had to increase the window size to actually trigger the bug (I think) by maximing the window; but I'm not 100% certain. Maybe another reload without window size increase would've triggered it as well)

Flags: needinfo?(pbz)

Bug 1854940 will help mitigate these "loop" issues. But it's still not ideal. We shouldn't try to handle an already handled banner.

See Also: → 1854940

This rule is causing the breakage, it tries to click a banner that's present in the DOM, but not visible: https://github.com/mozilla/cookie-banner-rules-list/blob/983f29aae02e830c49614e3aa23a2700d9a41633/cookie-banner-rules-list.json#L57-L64

A fix would be to split up the global onetrust rule into two rules with the "presence" selectors set on the actual parent and not the wrapper (which is always a visible element?):

    {
      "id": "onetrust-banner-sdk",
      "domains": [],
      "click": {
        "optIn": "#onetrust-accept-btn-handler",
        "optOut": "#onetrust-reject-all-handler",
        "presence": "#onetrust-banner-sdk"
      }
    },
    {
      "id": "onetrust-pc-sdk",
      "domains": [],
      "click": {
        "optIn": "#accept-recommended-btn-handler",
        "optOut": ".ot-pc-refuse-all-handler",
        "presence": "#onetrust-pc-sdk"
      }
Blocks: cbh-cmp
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(pbz)
Priority: -- → P2

The rules above seem to break some sites. The banner is handled but the overlay doesn't disappear. For example https://www.sport.pl/ is affected. We will need to tweak the rule some more.

Only affects current Nightly where global rules are enabled.

Abhishek, this is the bug I've mentioned that you could take once you're done with your other work.

Flags: needinfo?(amadan)

Bumping priority. This needs to be addressed in the current cycle.

Assignee: nobody → amadan
Status: NEW → ASSIGNED
Flags: needinfo?(amadan)
Priority: P2 → P1
Blocks: 1861377
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: