tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

TransientPrefs.sys.mjs (634B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 var prefVisibility = new Map();
      6 
      7 /* Use for preferences that should only be visible when they've been modified.
      8   When reset to their default state, they remain visible until restarting the
      9   application. */
     10 
     11 export var TransientPrefs = {
     12  prefShouldBeVisible(prefName) {
     13    if (Services.prefs.prefHasUserValue(prefName)) {
     14      prefVisibility.set(prefName, true);
     15    }
     16 
     17    return !!prefVisibility.get(prefName);
     18  },
     19 };