Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/prefs.js

Issue 29784585: Issue 6675 - Don't use relative path for info module require (Closed)
Patch Set: Created May 17, 2018, 1:48 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/options.js ('k') | lib/subscriptionInit.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 { 283 {
284 return keyPrefix + pref; 284 return keyPrefix + pref;
285 } 285 }
286 286
287 function savePref(pref) 287 function savePref(pref)
288 { 288 {
289 return browser.storage.local.set({[prefToKey(pref)]: overrides[pref]}); 289 return browser.storage.local.set({[prefToKey(pref)]: overrides[pref]});
290 } 290 }
291 291
292 let customSave = new Map(); 292 let customSave = new Map();
293 if (require("../buildtools/info").platform == "gecko") 293 if (require("info").platform == "gecko")
294 { 294 {
295 // Saving one storage value causes all others to be saved as well on Gecko. 295 // Saving one storage value causes all others to be saved as well on Gecko.
296 // Make sure that updating ad counter doesn't cause the filters data to be 296 // Make sure that updating ad counter doesn't cause the filters data to be
297 // saved frequently as a side-effect. 297 // saved frequently as a side-effect.
298 const MIN_UPDATE_INTERVAL = 60 * 1000; 298 const MIN_UPDATE_INTERVAL = 60 * 1000;
299 let lastUpdate = -MIN_UPDATE_INTERVAL; 299 let lastUpdate = -MIN_UPDATE_INTERVAL;
300 let promise = null; 300 let promise = null;
301 customSave.set("blocked_total", pref => 301 customSave.set("blocked_total", pref =>
302 { 302 {
303 if (!promise) 303 if (!promise)
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 eventEmitter.emit(pref); 382 eventEmitter.emit(pref);
383 } 383 }
384 } 384 }
385 }); 385 });
386 } 386 }
387 387
388 Prefs.untilLoaded = Promise.all([localLoaded, managedLoaded]).then(onLoaded); 388 Prefs.untilLoaded = Promise.all([localLoaded, managedLoaded]).then(onLoaded);
389 } 389 }
390 390
391 init(); 391 init();
OLDNEW
« no previous file with comments | « lib/options.js ('k') | lib/subscriptionInit.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld