| Index: lib/prefs.js |
| =================================================================== |
| --- a/lib/prefs.js |
| +++ b/lib/prefs.js |
| @@ -41,9 +41,13 @@ |
| 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 preconfigurable = ["suppress_first_run_page", "disable_auto_updates"]; |
| + |
| let values = Object.create(defaults); |
| let path = _fileSystem.resolve("prefs.json"); |
| let listeners = []; |
| @@ -131,7 +135,22 @@ |
| }, |
| }; |
| +// 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 _preconfiguredPrefs |
| +for (let key in _preconfiguredPrefs) |
|
Felix Dahlke
2015/06/12 12:37:08
Two things and we're done:
1. Turn the `let value
Oleksandr
2015/06/17 13:27:41
Done. Miss-understood your intent before.
|
| +{ |
| + if (preconfigurable.indexOf(key) != -1) |
| + { |
| + values[key] = _preconfiguredPrefs[key]; |
| + } |
| +} |
| + |
| load(); |