These notes are for changes to src/policies/firefox.json: adding new Firefox policies, extending existing policies,
and keeping the generated UI, output, translations, and tests in sync.
The files you will usually touch are:
src/policies/firefox.json: policies, categories, options, presets, and validationssrc/_locales/*/messages.json: all visible textpolicies-schema.json: validation schema forfirefox.json
The UI and output code are mostly generic. If a policy can be described in firefox.json, prefer that over adding
policy-specific JavaScript.
If a change needs more context, these files are usually the next stop:
src/js/core/configurator.js: builds the form fromfirefox.jsonsrc/js/core/output.js: turns the form state intopolicies.json
- File structure: top-level sections in
firefox.json - Policy metadata: availability, categories, notices, links, and special flags
- Schema types:
boolean,enum,string,object,array, andheading - Objects and arrays: nested structures, dynamic keys, and repeatable fields
- String fields and validation: required fields, URL schemes, numbers, JSON, and regex checks
- Localization: message keys and locale requirements
- Recipes: copyable examples for common policy shapes
- Tests and checklist: checks to run before committing
Every policy definition should answer three questions:
- Where does it appear in the UI?
- Which controls does the user need?
- What exact JSON should be generated?
If those answers are clear in firefox.json, the rest of the generator usually works without additional code.
Next: File structure