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

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.

Attachments (0)

Change History (6)

comment:1 Changed on 05/01/2015 at 07:14:31 PM by fhd

  • Description modified (diff)

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

Last edited on 05/07/2015 at 12:04:33 PM by fhd

comment:6 Changed on 03/07/2016 at 11:47:04 AM by trev

  • Blocked By 2850 added

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from fhd.
 
Note: See TracTickets for help on using tickets.