Bug 1852754: part 9) Add tests for dynamically loading <link rel="prefetch"> elements...
[gecko.git] / services / settings / RemoteSettingsComponents.sys.mjs
blob9f7687514ff49c168adc3c549b63b2babf281193
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/. */
5 const lazy = {};
7 ChromeUtils.defineESModuleGetters(lazy, {
8   RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
9 });
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",
17   // By default, this timer fires once every 24 hours. See the "services.settings.poll_interval" pref.
18   notify(timer) {
19     lazy.RemoteSettings.pollChanges({ trigger: "timer" }).catch(e =>
20       console.error(e)
21     );
22   },