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

Unified Diff: lib/prefs.js

Issue 5653480979038208: Issue 2325 - Add a way to set settings in libadblockplus for FRP and automatic updates (Closed)
Patch Set: Address more comments Created June 22, 2015, 7:45 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 | « include/AdblockPlus/JsEngine.h ('k') | lib/updater.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
@@ -41,10 +41,14 @@
update_hard_expiration: 0,
currentVersion: "0.0",
notificationdata: {},
- notificationurl: "https://notification.adblockplus.org/notification.json"
+ notificationurl: "https://notification.adblockplus.org/notification.json",
+ suppress_first_run_page: false,
+ disable_auto_updates: false
};
-let values = Object.create(defaults);
+let preconfigurable = ["suppress_first_run_page", "disable_auto_updates"];
+
+let values;
let path = _fileSystem.resolve("prefs.json");
let listeners = [];
let isDirty = false;
@@ -131,7 +135,16 @@
},
};
+// Update the default prefs with what was preconfigured
+for (let key in _preconfiguredPrefs)
+ if (preconfigurable.indexOf(key) != -1)
+ defaults[key] = _preconfiguredPrefs[key];
+
+// Define defaults
for (let key in defaults)
defineProperty(key);
+// Set values of prefs based on defaults
+values = Object.create(defaults);
+
load();
« no previous file with comments | « include/AdblockPlus/JsEngine.h ('k') | lib/updater.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld