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

Unified Diff: lib/prefs.js

Issue 29713631: Issue 5760 - Use relative require paths (Closed)
Patch Set: Address PS2 comments, rebase Created March 30, 2018, 3:09 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/popupBlocker.js ('k') | lib/requestBlocker.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/prefs.js
===================================================================
--- a/lib/prefs.js
+++ b/lib/prefs.js
@@ -14,17 +14,17 @@
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
/** @module prefs */
"use strict";
-const {EventEmitter} = require("events");
+const {EventEmitter} = require("../adblockpluscore/lib/events");
const keyPrefix = "pref:";
let eventEmitter = new EventEmitter();
let overrides = Object.create(null);
/** @lends module:prefs.Prefs */
let defaults = Object.create(null);
@@ -260,17 +260,17 @@
}
function savePref(pref)
{
ext.storage.set(prefToKey(pref), overrides[pref]);
}
let customSave = new Map();
-if (require("info").platform == "gecko")
+if (require("../buildtools/info").platform == "gecko")
{
// Saving one storage value causes all others to be saved as well on Gecko.
// Make sure that updating ad counter doesn't cause the filters data to be
// saved frequently as a side-effect.
const MIN_UPDATE_INTERVAL = 60 * 1000;
let lastUpdate = -MIN_UPDATE_INTERVAL;
let updateScheduled = false;
customSave.set("blocked_total", pref =>
« no previous file with comments | « lib/popupBlocker.js ('k') | lib/requestBlocker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld