Open Bug 1790688 Opened 2 years ago Updated 1 year ago

Move cookie banner handling mode logic from CookieBannerParent to nsCookieBannerService

Categories

(Core :: Privacy: Anti-Tracking, task, P3)

task

Tracking

()

People

(Reporter: pbz, Unassigned)

References

(Blocks 1 open bug)

Details

CookieBannerParent currently looks at the mode and returns the opt-in or opt-out click rule based on the pref. For cookie injection we do this directly in nsCookieBannerService. This is a bit confusing and leads to duplicate code. I propose that we move all mode handling logic to nsCookieBannerService and make the mode completely transparent for consumers.

https://searchfox.org/mozilla-central/rev/7b36c8b83337c4b4cdfd4ccc2168f3491a86811b/toolkit/components/cookiebanners/CookieBannerParent.jsm#53,56,59

+1 to this. I am essentially duplicating this logic inside browser/base/content/browser-siteProtections.js, in the cookieBannerHandling#hasException method. Would be great to centralize this logic in one place, especially since it can be challenging to figure out which C++ errors we need to catch on the front-end.

You need to log in before you can comment on or make changes to this bug.