commit 3b0bf1ae81c92cd962e33d9718af0230008e9745
parent 20d09a197ad06b9527bea0876cf626f224092c3a
Author: Henry Wilkes <henry@torproject.org>
Date: Mon, 16 Feb 2026 13:22:55 +0000
fixup! BB 43525: Skip Remote Settings for search engine customization.
TB 44647: Re-implement the search configuration patch in a more minimal
form.
Diffstat:
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/toolkit/components/search/SearchEngineSelector.sys.mjs b/toolkit/components/search/SearchEngineSelector.sys.mjs
@@ -98,7 +98,8 @@ export class SearchEngineSelector {
]);
let remoteSettingsData = await this.#getConfigurationPromise;
this.#configuration = remoteSettingsData[0];
- this.#getConfigurationPromise = null;
+ // For Base Browser, we don't expect the configuration to ever change in a
+ // session, so we keep the #getConfigurationPromise as-is for later calls.
if (!this.#configuration?.length) {
throw Components.Exception(
@@ -110,7 +111,8 @@ export class SearchEngineSelector {
/**
* Records whether the listeners have been added or not.
*/
- if (!this.#listenerAdded) {
+ // For Base Browser, we don't use remoteConfig. tor-browser#43525.
+ if (!AppConstants.BASE_BROWSER_VERSION && !this.#listenerAdded) {
this.#remoteConfig.on("sync", this.#boundOnConfigurationUpdated);
this.#remoteConfigOverrides.on(
"sync",
@@ -332,6 +334,15 @@ export class SearchEngineSelector {
* could be obtained.
*/
async #getConfiguration(firstTime = true) {
+ if (AppConstants.BASE_BROWSER_VERSION) {
+ // For Base Browser, load the config from a local file, rather than
+ // #remoteConfig. tor-browser#43525.
+ return (
+ await fetch(
+ "chrome://global/content/search/base-browser-search-engines.json"
+ )
+ ).json();
+ }
let result = [];
let failed = false;
try {
@@ -425,6 +436,10 @@ export class SearchEngineSelector {
* could be obtained.
*/
async #getConfigurationOverrides() {
+ if (AppConstants.BASE_BROWSER_VERSION) {
+ // For Base Browser, we don't want overrides. tor-browser#43525.
+ return [];
+ }
let result = [];
try {
result = await this.#remoteConfigOverrides.get();