Bug 1108627: market-specific search defaults broke default engine behavior for Fennec, so make it desktop Firefox-only, r=dolske

This commit is contained in:
Gavin Sharp 2014-12-08 13:54:17 -08:00
parent bde2a6eb5c
commit be34215a78
2 changed files with 11 additions and 0 deletions

View File

@ -404,6 +404,8 @@ pref("browser.search.order.1", "chrome://browser-region/locale/re
pref("browser.search.order.2", "chrome://browser-region/locale/region.properties");
pref("browser.search.order.3", "chrome://browser-region/locale/region.properties");
// Market-specific search defaults (US market only)
pref("browser.search.geoSpecificDefaults", true);
pref("browser.search.defaultenginename.US", "data:text/plain,browser.search.defaultenginename.US=Yahoo");
pref("browser.search.order.US.1", "data:text/plain,browser.search.order.US.1=Yahoo");
pref("browser.search.order.US.2", "data:text/plain,browser.search.order.US.2=Google");

View File

@ -404,6 +404,15 @@ loadListener.prototype = {
// Hacky method that tries to determine if this user is in a US geography, and
// using an en-US build.
function getIsUS() {
let geoSpecificDefaults = false;
try {
geoSpecificDefaults = Services.prefs.getBoolPref("browser.search.geoSpecificDefaults");
} catch(e) {}
if (!geoSpecificDefaults) {
return false;
}
// If we've set the pref before, just return that result.
let cachePref = "browser.search.isUS";
try {