tor-browser

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

RemoteSettingsComponents.sys.mjs (834B)


      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
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 const lazy = {};
      6 
      7 ChromeUtils.defineESModuleGetters(lazy, {
      8  RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
      9 });
     10 
     11 export var RemoteSettingsTimer = function () {};
     12 RemoteSettingsTimer.prototype = {
     13  QueryInterface: ChromeUtils.generateQI(["nsITimerCallback"]),
     14  classID: Components.ID("{5e756573-234a-49ea-bbe4-59ec7a70657d}"),
     15  contractID: "@mozilla.org/services/settings;1",
     16 
     17  // By default, this timer fires once every 24 hours. See the "services.settings.poll_interval" pref.
     18  notify() {
     19    lazy.RemoteSettings.pollChanges({ trigger: "timer" }).catch(e =>
     20      console.error(e)
     21    );
     22  },
     23 };