@@ -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.
0 commit comments