Bug 1835625 - Let nightly users set custom param prefs. r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D179352
This commit is contained in:
Dale Harvey 2023-06-02 13:34:42 +00:00
Родитель 183be490b1
Коммит 1b230888fa
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -4,6 +4,7 @@
/* eslint no-shadow: error, mozilla/no-aArgs: error */
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
@ -120,7 +121,12 @@ const ParamPreferenceCache = {
]),
initCache() {
this.branch = Services.prefs.getDefaultBranch(
// Preference params are normally only on the default branch to avoid these being easily changed.
// We allow them on the normal branch in nightly builds to make testing easier.
let branchFetcher = AppConstants.NIGHTLY_BUILD
? "getBranch"
: "getDefaultBranch";
this.branch = Services.prefs[branchFetcher](
lazy.SearchUtils.BROWSER_SEARCH_PREF + "param."
);
this.cache = new Map();