gecko-dev/modules/libpref/docs
Nicholas Nethercote 00c92b3d71 Bug 1632279 - Disallow default pref definitions in user pref files. r=KrisWright
We distinguish between two kinds of pref syntax.
- "Default pref files" are the ones that come with Firefox, constructed from
  `all.js` and similar files.
- "User pref files" are the ones that get created in the user's profile.
  `prefs.js` is the one that Firefox creates and overwrites every time a pref
  changes. `user.js` is the one that users can create themselves.

We also have two basic kinds of pref.
- Default: `pref(...)` and the unfortunate `sticky_pref(...)`.
- User: `user_pref(...)`, which override but don't replace the default.

It only makes sense for user pref files to contain user prefs; users shouldn't
be able to create default prefs or change default pref values.

But it turns out that user pref files have been able to define default prefs
pretty much forever. This appears to be an oversight, and this commit restricts
things so that user pref files cannot contain default prefs.

The commit also fixes an incorrect comment in testParser.js.

Differential Revision: https://phabricator.services.mozilla.com/D73003
2020-04-29 21:47:12 +00:00
..
index.md Bug 1632279 - Disallow default pref definitions in user pref files. r=KrisWright 2020-04-29 21:47:12 +00:00