Skip to main content

PrefPicker

CI codecov Matrix PyPI

Manage & generate prefs.js files for use when testing Firefox. This tool is intended to simplify the use and tracking of prefs used by our fuzzing tools. The template files can be modified to allow the creation of custom prefs.js files without the need to maintain a separate mostly duplicate version of a prefs file.

YAML Template Structure

The template document is made up of variants, prefs and values.

pref is the name of the preference that will be added to the prefs.js file. This is an unquoted string. Valid prefs can be found in all.js or in StaticPrefList.yml.

review_on_close is optional. It is a list of relevant Bugzilla IDs used to help avoid obsolete entries. When all bugs in the list are closed the entry will be reviewed and removed if appropriate.

value can be a bool, int, string or null. Adding multiple potential values is possible. When multiple values are present one is chosen at random when generating the output. Using a value of null will exclude the pref from the prefs.js file (acts as browser default).

variant is a subset of values to be used in place of the default values. The default variant is used unless a variant is specified.

There are a few mechanisms in place to help keep the file in order:

  • All prefs must have a default variant
  • All variants must be defined in the variant list
  • All variants in the variant list must be used
  • All variants must be a list and contain values
# example.yml
variant:              # list of extra variants, default is implied
- alt                 # name of variant
pref:
  pref.name:          # unquoted name of the pref used in prefs.js
    review_on_close:  # optional
    - 123456
    variants:
      default:        # variant definition, default is required
      - 0             # potential value
      alt:            # extra optional variant
      - 1             # if multiple values are defined one is chosen randomly
      - null          # null is a special case meaning exclude the pref

Updating Templates and Adding Prefs

Prefs are found in the .yml files in the template directory. Only prefs that are ready to be tested should be added. When adding a pref to a template it is encouraged to add a comment that provides justification and points to a bug in Bugzilla for additional context. If a pref does not already exist and is only used with non-default variants a null entry must be added to the default variant.

Quick Setup

Use pip to install prefpicker.

pip install prefpicker

Examples

Use a built-in template to generate an up-to-date prefs.js file.

prefpicker browser-fuzzing.yml prefs.js

Or generate a prefs.js file from a custom template using the webrender variant:

user@machine:~/prefpicker$ prefpicker custom/template.yml ~/Desktop/prefs.js --variant webrender
Loading 'template.yml'...
Loaded 255 prefs and 5 variants
Generating 'prefs.js' using variant 'webrender'...
Done.

The resulting prefs.js file is ready to be used with Firefox. It will look something like this:

// Generated with PrefPicker @ 2020-02-08 00:50:29 UTC
// Variant 'webrender'
/// ... snip
user_pref("fuzzing.enabled", true);
/// ... snip
// 'gfx.webrender.all' defined by variant 'webrender'
user_pref("gfx.webrender.all", true);
/// ... snip

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prefpicker-2.25.0.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prefpicker-2.25.0-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file prefpicker-2.25.0.tar.gz.

File metadata

  • Download URL: prefpicker-2.25.0.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for prefpicker-2.25.0.tar.gz
Algorithm Hash digest
SHA256 6852109464a9a39c0dff6e072b4829b303afb9cd26626590556828b7c70d2a2d
MD5 c90215aeb725c905da3f7210f153d38b
BLAKE2b-256 879a8714dfe24cec24943fcc46845cc065e9b55efec399be5583c6624e9bb273

See more details on using hashes here.

Provenance

The following attestation bundles were made for prefpicker-2.25.0.tar.gz:

Publisher: ci.yml on MozillaSecurity/prefpicker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file prefpicker-2.25.0-py3-none-any.whl.

File metadata

  • Download URL: prefpicker-2.25.0-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for prefpicker-2.25.0-py3-none-any.whl
Algorithm Hash digest
SHA256 121bc3136aaa6ffb4ce9e3b8c8b7bc5110065717b2d0a640f67ad0b46ad5d5a8
MD5 ac52ad9d6d635472007bbe2dc01d133f
BLAKE2b-256 26ae934d75056ece7adb19798d17b4ec9a09b24ef832d3142a688a79f2809a0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for prefpicker-2.25.0-py3-none-any.whl:

Publisher: ci.yml on MozillaSecurity/prefpicker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.27.0

2 files

2.26.0

2 files

This release

2.25.0 This release

2 files

2.24.1

2 files

2.24.0

2 files

2.23.1

2 files

2.23.0

2 files

2.22.0

2 files

2.21.0

2 files

2.20.0

2 files

2.19.0

2 files

2.18.0

2 files

2.17.0

2 files

2.16.1

2 files

2.16.0

2 files

2.15.1

2 files

2.15.0

2 files

2.14.0

2 files

2.13.1

2 files

2.13.0

2 files

2.12.0

2 files

2.11.0

2 files

2.10.0

2 files

2.9.1

2 files

2.9.0

2 files

2.7.1

2 files

2.7.0

2 files

2.6.1

2 files

2.6.0

2 files

2.5.0

2 files

2.4.0

2 files

2.3.0

2 files

2.2.0

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.0

2 files

1.25.0

2 files

1.24.4

2 files

1.24.3

2 files

1.24.2

2 files

1.24.1

2 files

1.24.0

2 files

1.23.7

2 files

1.23.6

2 files

1.23.0

2 files

1.22.2

2 files

1.22.1

2 files

1.22.0

2 files

1.21.0

2 files

1.20.0

2 files

1.19.1

2 files

1.19.0

2 files

1.18.0

2 files

1.17.0

2 files

1.16.0

2 files

1.15.0

2 files

1.14.0

2 files

1.13.0

2 files

1.12.0

1 file

1.11.0

2 files

1.10.0

2 files

1.9.2

2 files

1.9.0

2 files

1.8.1

2 files

1.8.0

2 files

1.7.1

2 files

1.7.0

2 files

1.6.1

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.2.0

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.27

2 files

1.0.26

2 files

1.0.25

2 files

1.0.24

2 files

1.0.23

2 files

1.0.22

2 files

1.0.21

2 files

1.0.20

2 files

1.0.19

2 files

1.0.18

2 files

1.0.16

2 files

1.0.15

2 files

1.0.14

2 files

1.0.13

2 files

1.0.12

2 files

1.0.11

2 files

1.0.9

2 files

1.0.8

2 files

1.0.6

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page