Skip to content
This repository was archived by the owner on Nov 13, 2025. It is now read-only.

Commit b032668

Browse files
committed
Add r3dfox option for cookiebanners and remove stock setting
1 parent 117237e commit b032668

File tree

5 files changed

+30
-113
lines changed

5 files changed

+30
-113
lines changed

browser/components/preferences/privacy.inc.xhtml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -458,25 +458,6 @@
458458
</hbox>
459459
</groupbox>
460460

461-
<!-- Cookie Banner Handling -->
462-
<groupbox id="cookieBannerHandlingGroup" data-category="panePrivacy" data-subcategory="cookiebanner" hidden="true">
463-
<label><html:h2 data-l10n-id="cookie-banner-blocker-header" /></label>
464-
<vbox flex="1">
465-
<hbox>
466-
<description class="description-deemphasized">
467-
<html:span id="cookieBannerReductionExplanation" data-l10n-id="cookie-banner-blocker-description" ></html:span>
468-
<html:a is="moz-support-link" id="cookieBannerHandlingLearnMore" class="learnMore" data-l10n-id="cookie-banner-learn-more" support-page="cookie-banner-reduction"/>
469-
</description>
470-
</hbox>
471-
<hbox>
472-
<checkbox id="handleCookieBanners"
473-
preference="cookiebanners.service.mode.privateBrowsing"
474-
data-l10n-id="cookie-banner-blocker-checkbox-label"
475-
flex="1" />
476-
</hbox>
477-
</vbox>
478-
</groupbox>
479-
480461
<!-- Passwords -->
481462
<groupbox id="passwordsGroup" orient="vertical" data-category="panePrivacy" data-subcategory="logins" hidden="true">
482463
<label><html:h2 data-l10n-id="pane-privacy-passwords-header" data-l10n-attrs="searchkeywords"/></label>

browser/components/preferences/privacy.js

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,6 @@ Preferences.addAll([
259259
{ id: "browser.urlbar.quickactions.showPrefs", type: "bool" },
260260
{ id: "browser.urlbar.suggest.quickactions", type: "bool" },
261261

262-
// Cookie Banner Handling
263-
{ id: "cookiebanners.ui.desktop.enabled", type: "bool" },
264-
{ id: "cookiebanners.service.mode.privateBrowsing", type: "int" },
265-
266262
// DoH
267263
{ id: "network.trr.mode", type: "int" },
268264
{ id: "network.trr.uri", type: "string" },
@@ -1211,8 +1207,6 @@ var gPrivacyPane = {
12111207
gPrivacyPane.showSiteDataSettings
12121208
);
12131209

1214-
this.initCookieBannerHandling();
1215-
12161210
this.initDataCollection();
12171211

12181212
if (AppConstants.MOZ_DATA_REPORTING) {
@@ -2619,86 +2613,6 @@ var gPrivacyPane = {
26192613
);
26202614
},
26212615

2622-
/**
2623-
* Initializes the cookie banner handling subgroup on the privacy pane.
2624-
*
2625-
* This UI is shown if the "cookiebanners.ui.desktop.enabled" pref is true.
2626-
*
2627-
* The cookie banner handling checkbox reflects the cookie banner feature
2628-
* state. It is enabled when the service enabled via the
2629-
* cookiebanners.service.mode pref. If detection-only mode is enabled the
2630-
* checkbox is unchecked, since in this mode no banners are handled. It is
2631-
* only used for detection for banners which means we may prompt the user to
2632-
* enable the feature via other UI surfaces such as the onboarding doorhanger.
2633-
*
2634-
* If the user checks the checkbox, the pref value is set to
2635-
* nsICookieBannerService.MODE_REJECT_OR_ACCEPT.
2636-
*
2637-
* If the user unchecks the checkbox, the mode pref value is set to
2638-
* nsICookieBannerService.MODE_DISABLED.
2639-
*
2640-
* Advanced users can choose other int-valued modes via about:config.
2641-
*/
2642-
initCookieBannerHandling() {
2643-
setSyncFromPrefListener("handleCookieBanners", () =>
2644-
this.readCookieBannerMode()
2645-
);
2646-
setSyncToPrefListener("handleCookieBanners", () =>
2647-
this.writeCookieBannerMode()
2648-
);
2649-
2650-
let preference = Preferences.get("cookiebanners.ui.desktop.enabled");
2651-
preference.on("change", () => this.updateCookieBannerHandlingVisibility());
2652-
2653-
this.updateCookieBannerHandlingVisibility();
2654-
},
2655-
2656-
/**
2657-
* Reads the cookiebanners.service.mode.privateBrowsing pref,
2658-
* interpreting the multiple modes as a true/false value
2659-
*/
2660-
readCookieBannerMode() {
2661-
return (
2662-
Preferences.get("cookiebanners.service.mode.privateBrowsing").value !=
2663-
Ci.nsICookieBannerService.MODE_DISABLED
2664-
);
2665-
},
2666-
2667-
/**
2668-
* Translates user clicks on the cookie banner handling checkbox to the
2669-
* corresponding integer-valued cookie banner mode preference.
2670-
*/
2671-
writeCookieBannerMode() {
2672-
let checkbox = document.getElementById("handleCookieBanners");
2673-
if (!checkbox.checked) {
2674-
/* because we removed UI control for the non-PBM pref, disabling it here
2675-
provides an off-ramp for profiles where it had previously been enabled from the UI */
2676-
Services.prefs.setIntPref(
2677-
"cookiebanners.service.mode",
2678-
Ci.nsICookieBannerService.MODE_DISABLED
2679-
);
2680-
return Ci.nsICookieBannerService.MODE_DISABLED;
2681-
}
2682-
return Ci.nsICookieBannerService.MODE_REJECT;
2683-
},
2684-
2685-
/**
2686-
* Shows or hides the cookie banner handling section based on the value of
2687-
* the "cookiebanners.ui.desktop.enabled" pref.
2688-
*/
2689-
updateCookieBannerHandlingVisibility() {
2690-
let groupbox = document.getElementById("cookieBannerHandlingGroup");
2691-
let isEnabled = Preferences.get("cookiebanners.ui.desktop.enabled").value;
2692-
2693-
// Because the top-level pane showing code unsets the hidden attribute, we
2694-
// manually hide the section when cookie banner handling is preffed off.
2695-
if (isEnabled) {
2696-
groupbox.removeAttribute("style");
2697-
} else {
2698-
groupbox.setAttribute("style", "display: none !important");
2699-
}
2700-
},
2701-
27022616
/**
27032617
* Updates the visibility of the Firefox Suggest Privacy Container
27042618
* based on the user's Quick Suggest settings.

browser/components/preferences/r3dfox.inc.xhtml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,28 @@
183183
</hbox>
184184
<description id="r3dfoxAccessibilityDescription" class="tip-caption" data-l10n-id="r3dfox-accessibility-desc"/>
185185

186+
<hbox align="center">
187+
<label id="r3dfoxCookieBanners" data-l10n-id="r3dfox-cookiebanners" control="r3dfoxCookieBannersType"/>
188+
<menulist id="r3dfoxCookieBannersType" preference="cookiebanners.service.mode">
189+
<menupopup>
190+
<menuitem label="Auto reject all cookies where possible" value="1"/>
191+
<menuitem label="Disable all cookie banner handling" value="0"/>
192+
</menupopup>
193+
</menulist>
194+
</hbox>
195+
<description id="r3dfoxCookieBannersDescription" class="tip-caption" data-l10n-id="r3dfox-cookiebanners-desc"/>
196+
197+
<hbox align="center">
198+
<label id="r3dfoxCookieBannersPrivate" data-l10n-id="r3dfox-cookiebanners-private" control="r3dfoxCookieBannersPrivateType"/>
199+
<menulist id="r3dfoxCookieBannersPrivateType" preference="cookiebanners.service.mode.privateBrowsing">
200+
<menupopup>
201+
<menuitem label="Auto reject all cookies where possible" value="1"/>
202+
<menuitem label="Disable all cookie banner handling" value="0"/>
203+
</menupopup>
204+
</menulist>
205+
</hbox>
206+
<description id="r3dfoxCookieBannersPrivateDescription" class="tip-caption" data-l10n-id="r3dfox-cookiebanners-desc"/>
207+
186208
<hbox align="center">
187209
<checkbox id="r3dfoxcsp"
188210
data-l10n-id="r3dfox-csp"

browser/components/preferences/r3dfox.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ Preferences.addAll([
2929
{ id: "accessibility.force_disabled", type: "int" },
3030
{ id: "browser.urlbar.secondaryActions.switchToTab", type: "bool" },
3131
{ id: "gfx.dwrite.enabled", type: "bool", inverted: true },
32+
{ id: "cookiebanners.service.mode", type: "int" },
33+
{ id: "cookiebanners.service.mode.privateBrowsing", type: "int" },
3234
]);

browser/locales/en-US/browser/preferences/preferences.ftl

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ r3dfox-accessibility = Accessibility services
204204
205205
r3dfox-accessibility-desc = Recommended to disable if you do not need them for enhanced security and performance.
206206
207+
r3dfox-cookiebanners = Cookie banner handling mode in normal browsing
208+
209+
r3dfox-cookiebanners-desc = Recommended to leave enabled for a less annoying browsing experience. Currently this will set cookies even when set to block all cookies.
210+
211+
r3dfox-cookiebanners-private = Cookie banner handling mode in private browsing
212+
207213
r3dfox-csp =
208214
.label = Disable Content Security Policy (CSP)
209215
@@ -1295,14 +1301,6 @@ sitedata-cookies-exceptions =
12951301
.label = Manage Exceptions…
12961302
.accesskey = x
12971303
1298-
## Privacy Section - Cookie Banner Blocking
1299-
1300-
cookie-banner-blocker-header = Cookie Banner Blocker
1301-
cookie-banner-blocker-description = When a site asks if they can use cookies in private browsing mode, { -brand-short-name } automatically refuses for you. Only on supported sites.
1302-
cookie-banner-learn-more = Learn More
1303-
cookie-banner-blocker-checkbox-label =
1304-
.label = Automatically refuse cookie banners
1305-
13061304
## Privacy Section - Address Bar
13071305

13081306
addressbar-header = Address Bar

0 commit comments

Comments
 (0)