Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Manage & generate prefs.js files

License

NotificationsYou must be signed in to change notification settings

MozillaSecurity/prefpicker

Repository files navigation

CIcodecovMatrixPyPI

Manage & generate prefs.js files for use when testing Firefox. This tool is intended to simplify the use and tracking of prefs used byour fuzzing tools. The template files can be modified to allow the creation of custom prefs.js files withoutthe 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 inall.js or inStaticPrefList.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 abool,int,string ornull. Adding multiple potential values is possible.When multiple values are present one is chosen at random when generating the output.Using a value ofnull 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.ymlvariant:# list of extra variants, default is implied-alt# name of variantpref:pref.name:# unquoted name of the pref used in prefs.jsreview_on_close:# optional    -123456variants:default:# variant definition, default is required      -0# potential valuealt:# 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 thetemplate 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 anull entry must be added to the default variant.

Quick Setup

Use pip to install prefpicker.

pip install prefpicker

Examples

Use a built-intemplate to generate an up-to-dateprefs.js file.

prefpicker browser-fuzzing.yml prefs.js

Or generate aprefs.js file from a custom template using thewebrender variant:

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

The resultingprefs.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'/// ... snipuser_pref("fuzzing.enabled",true);/// ... snip// 'gfx.webrender.all' defined by variant 'webrender'user_pref("gfx.webrender.all",true);/// ... snip

About

Manage & generate prefs.js files

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Contributors8

Languages


[8]ページ先頭

©2009-2025 Movatter.jp