Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#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):

http://codereview.adblockplus.org/6443935886999552/

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.

Change History (6)

comment:1 Changed 5 years ago by fhd

  • Description modified (diff)

comment:2 Changed 5 years ago by fhd

  • Owner set to fhd

comment:3 Changed 5 years ago by fhd

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:4 Changed 5 years ago by fhd

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:6 Changed 4 years ago by trev

  • Blocked By 2850 added
Note: See TracTickets for help on using tickets.