diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 1f899a036455..0a49b425fe1d 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -368,6 +368,11 @@ pref("browser.search.update.interval", 21600); // enable search suggestions by default pref("browser.search.suggest.enabled", true); +#ifdef MOZ_OFFICIAL_BRANDING +// {moz:official} expands to "official" +pref("browser.search.official", true); +#endif + pref("browser.sessionhistory.max_entries", 50); // handle links targeting new windows diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js index 126e46953bb2..89ffe8950d60 100644 --- a/mobile/android/app/mobile.js +++ b/mobile/android/app/mobile.js @@ -262,6 +262,11 @@ pref("browser.search.jarURIs", "chrome://browser/locale/searchplugins/"); // tell the search service that we don't really expose the "current engine" pref("browser.search.noCurrentEngine", true); +#ifdef MOZ_OFFICIAL_BRANDING +// {moz:official} expands to "official" +pref("browser.search.official", true); +#endif + // enable xul error pages pref("browser.xul.error_pages.enabled", true); diff --git a/mobile/xul/app/mobile.js b/mobile/xul/app/mobile.js index 81e3639da099..494f594f66b9 100644 --- a/mobile/xul/app/mobile.js +++ b/mobile/xul/app/mobile.js @@ -256,6 +256,11 @@ pref("browser.search.jarURIs", "chrome://browser/locale/searchplugins/"); // tell the search service that we don't really expose the "current engine" pref("browser.search.noCurrentEngine", true); +#ifdef MOZ_OFFICIAL_BRANDING +// {moz:official} expands to "official" +pref("browser.search.official", true); +#endif + // enable xul error pages pref("browser.xul.error_pages.enabled", true); diff --git a/toolkit/components/search/nsSearchService.js b/toolkit/components/search/nsSearchService.js index cc23ca83e7e6..3d0b9980619a 100644 --- a/toolkit/components/search/nsSearchService.js +++ b/toolkit/components/search/nsSearchService.js @@ -803,13 +803,21 @@ function ParamSubstitution(aParamValue, aSearchTerms, aEngine) { distributionID = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "distributionID"); } catch (ex) { } + var official = MOZ_OFFICIAL; + try { + if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "official")) + official = "official"; + else + official = "unofficial"; + } + catch (ex) { } // Custom search parameters. These are only available to default search // engines. if (aEngine._isDefault) { value = value.replace(MOZ_PARAM_LOCALE, getLocale()); value = value.replace(MOZ_PARAM_DIST_ID, distributionID); - value = value.replace(MOZ_PARAM_OFFICIAL, MOZ_OFFICIAL); + value = value.replace(MOZ_PARAM_OFFICIAL, official); } // Insert the OpenSearch parameters we're confident about