зеркало из https://github.com/mozilla/gecko-dev.git
Bug 826996 - Avoid hardcoded value for {moz:official} in search plugins. r=gavin
--HG-- extra : rebase_source : fe2a5b7c6efed6ff7f4b786a0ce510fc28a25ef9
This commit is contained in:
Родитель
764ebaf77e
Коммит
032a047cc1
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче