async set(name, value) {
    await this.#initializedPromise;
    AppOptions.setAll({ [name]: value }, /* prefs = */ true);

    await this._writeToStorage(
      typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")
        ? { [name]: AppOptions.get(name) }
        : AppOptions.getAll(OptionKind.PREFERENCE)
    );
  }
Set the value of a preference.
@param {string} name The name of the preference that should be changed.
@param {boolean|number|string} value The new value of the preference.
@returns {Promise} A promise that is resolved when the value has been set,
                   provided that the preference exists and the types match.