Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  IPPOptOutHelper.sys.mjs   Sprache: unbekannt

 
Spracherkennung für: .mjs vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

const lazy = {};

ChromeUtils.defineESModuleGetters(lazy, {
  CustomizableUI:
    "moz-src:///browser/components/customizableui/CustomizableUI.sys.mjs",
  IPProtectionService:
    "moz-src:///toolkit/components/ipprotection/IPProtectionService.sys.mjs",
});

const OPTED_OUT_PREF = "browser.ipProtection.optedOut";
const WIDGET_ID = "ipprotection-button";

/**
 * This class monitors the optedOut pref and if it sees an opted-out state, it
 * sets the state on IPProtectionService and removes the toolbar widget.
 */
class IPPOptedOutHelperSingleton {
  init() {
    Services.prefs.addObserver(OPTED_OUT_PREF, this);
  }

  uninit() {
    Services.prefs.removeObserver(OPTED_OUT_PREF, this);
  }

  initOnStartupCompleted() {}

  get optedOut() {
    return Services.prefs.getBoolPref(OPTED_OUT_PREF, false);
  }

  observe(_subject, _topic, _data) {
    lazy.IPProtectionService.updateState();
    if (this.optedOut) {
      lazy.CustomizableUI.removeWidgetFromArea(WIDGET_ID);
    }
  }
}

const IPPOptOutHelper = new IPPOptedOutHelperSingleton();

export { IPPOptOutHelper };

[Dauer der Verarbeitung: 0.43 Sekunden]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002