Opened on 05/01/2015 at 07:13:54 PM
Closed on 05/04/2015 at 04:34:13 PM
Last modified on 03/07/2016 at 11:47:04 AM
#2444 closed change (fixed)
Configure default prefs in JSON
| Reported by: | fhd | Assignee: | fhd | 
|---|---|---|---|
| Priority: | Unknown | Milestone: | |
| Module: | Automation | Keywords: | |
| Cc: | trev | Blocked By: | #2850 | 
| Blocking: | Platform: | Unknown | |
| Ready: | yes | Confidential: | no | 
| Tester: | Verified working: | no | |
| Review URL(s): | |||
Description (last modified by fhd)
Background
Default prefs are currently configured in defaults/prefs.js, in which we call the pref() function to set the defaults. It would be more flexible to configure these default prefs in a JSON file.
What to change
Instead of prefs.js, load a JSON file called prefs.json with the following format:
{
  "defaults": {
    "enabled": true,
    "suppress_first_run_page": false
  },
  "preconfigurable": ["suppress_first_run_page"]
}
The defaults property has all the prefs and their default values. Note that contrary to prefs.js, we should omit the preferences branch (extensions.adblockplus) in prefs.json.
The preconfigurable property has a list of pref names that should be preconfigurable - based on the same logic as the third parameter of our pref() function.
Attachments (0)
Change History (6)
comment:2 Changed on 05/01/2015 at 08:35:57 PM by fhd
- Owner set to fhd
 
comment:3 Changed on 05/01/2015 at 08:36:12 PM by fhd
- Review URL(s) modified (diff)
 - Status changed from new to reviewing
 
comment:4 Changed on 05/04/2015 at 04:34:13 PM by fhd
- Resolution set to fixed
 - Status changed from reviewing to closed
 
comment:5 Changed on 05/07/2015 at 12:02:27 PM by fhd
comment:6 Changed on 03/07/2016 at 11:47:04 AM by trev
- Blocked By 2850 added
 

Was pushed as https://hg.adblockplus.org/buildtools/rev/6c80b73656da and https://hg.adblockplus.org/buildtools/rev/97e2e12af6e8.