Closed Bug 1783019 Opened 2 years ago Closed 2 years ago

Add a cookie banner service to automatically handle website cookie banners

Categories

(Core :: Privacy: Anti-Tracking, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: pbz, Assigned: pbz)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxatps-cbh])

Attachments

(3 files)

The service nsICookieBannerService will be initialized on startup and manage the following components for handling cookie banners:

  • nsICookieBannerRule / nsICookieRule / nsIClickRule: Rules containing instructions on how to handle cookie banners for a specific site.
  • nsCookieInjector: Inject / preload cookies based on rules in order to suppress cookie banners.
  • nsICookieBannerListService: Imports cookie banner handling rules and sync them with the nsICookieBannerService on update.

nsICookieBannerService should have methods for querying banner handling rules by domain or URI.

This patch adds the following components:

  • nsICookieBannerService: Main service singleton managing the rules and initiating other components.
    It's exposed via Services.cookieBanners and can be configured via the cookiebanners.* prefs.
    To enable it set "cookiebanners.service.mode" to 1 or 2 and restart the browser.
  • nsCookieInjector: Looks up rules and injects cookies for matching top level loads.
  • nsICookieBannerListService: Imports and updates the cookie banner rules.
  • nsICookieBannerRule: Rules for a given domain.
  • nsICookieRule: Part of nsICookieBannerRule. Holds cookie specific rules.

Depends on D153641

Blocks: 1783045
Assignee: nobody → pbz
Status: NEW → ASSIGNED
Attachment #9288355 - Attachment description: WIP: Bug 1783019 - Add 'http-on-modify-request-before-cookies' observer message. r=#necko! → Bug 1783019 - Add 'http-on-modify-request-before-cookies' observer message. r=#necko!
Attachment #9288356 - Attachment description: WIP: Bug 1783019 - Implement cookie banner handling components. r=timhuang!,#necko! → Bug 1783019 - Implement cookie banner handling components. r=timhuang!,#necko!
Blocks: 1784874
Attachment #9288356 - Attachment description: Bug 1783019 - Implement cookie banner handling components. r=timhuang!,#necko! → Bug 1783019 - Implement cookie banner handling components. r=timhuang!,#necko!
Pushed by pzuhlcke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9ad6a65247e9
Add 'http-on-modify-request-before-cookies' observer message. r=necko-reviewers,timhuang,valentin
https://hg.mozilla.org/integration/autoland/rev/4ab33c18078d
Implement cookie banner handling components. r=timhuang,necko-reviewers,valentin
https://hg.mozilla.org/integration/autoland/rev/048a4baf2c06
Tests for nsICookieBannerService and nsCookieInjector. r=timhuang,necko-reviewers,valentin
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: