Commit 1b230888 authored by Dale Harvey's avatar Dale Harvey
Browse files

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

parent 183be490
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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();