Skip to main content

PrefPicker - Manage & generate prefs.js files

Project description

PrefPicker

Build Status codecov Matrix

Manage & generate prefs.js files. 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.

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 skip adding the pref to the output prefs.js file.

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 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 for extra variants, default is implied
 - alt        # name of variant
pref:
 pref.name:   # unquoted name of the pref used in prefs.js
   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 do not add the pref

Example

This is an example of how to generate a prefs.js file from a template using the webrender variant:

user@machine:~/prefpicker$ python -m prefpicker templates/browser-fuzzing.yml ~/Desktop/prefs.js --variant webrender
Loading 'browser-fuzzing.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
// Fingerprint '13370ddba11'

Project details


Download files

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

Source Distribution

prefpicker-1.0.2.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

prefpicker-1.0.2-py2.py3-none-any.whl (15.8 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: prefpicker-1.0.2.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.1

File hashes

Hashes for prefpicker-1.0.2.tar.gz
Algorithm Hash digest
SHA256 89b70a6fba4e9804a32e68c1374eca3f4a00479d5accd867479807c595f9c1ec
MD5 828170778586f7295f9c84fbfeaf5199
BLAKE2b-256 93d43dccf910df90859c9dc635776ad9d3f6db03fdbc28105f76cce2b479b604

See more details on using hashes here.

File details

Details for the file prefpicker-1.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: prefpicker-1.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.1

File hashes

Hashes for prefpicker-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4e961a664505a1939d8c6a18ee12156784bebdc72035556c3a9f03520f2bb0e2
MD5 6b85e2eeaf3033f3f61f766f36be1c51
BLAKE2b-256 57e2dd39d3fb3c10c65e9b4ce1650bfadbae30668d38f7ab0b48846d896d1c8e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page