Bug 1419312 - Expand supported locales and countries on Nightly and Beta. r=lchang
authorScott Wu <scottcwwu@gmail.com>
Mon, 15 Jan 2018 18:31:08 +0800
changeset 454175 1b36b7371595f88f2de56f1760d7088896f2a4e3
parent 454174 1765a455cc35fb3d3ccb7f2e3004bbacc7448105
child 454176 6b413c2c9bfe95213c92f8748f160dc4ef743941
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslchang
bugs1419312
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1419312 - Expand supported locales and countries on Nightly and Beta. r=lchang MozReview-Commit-ID: 8MziULBn05l
browser/app/profile/firefox.js
browser/extensions/formautofill/bootstrap.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1725,17 +1725,23 @@ pref("extensions.formautofill.creditCard
 // 2: saw the doorhanger
 // 3: submitted an autofill'ed credit card form
 pref("extensions.formautofill.creditCards.used", 0);
 pref("extensions.formautofill.firstTimeUse", true);
 pref("extensions.formautofill.heuristics.enabled", true);
 pref("extensions.formautofill.section.enabled", true);
 pref("extensions.formautofill.loglevel", "Warn");
 // Comma separated list of countries Form Autofill supports
+#ifdef MOZ_UPDATE_CHANNEL == release
+pref("extensions.formautofill.supportedCountries", "US");
+pref("extensions.formautofill.supportRTL", false);
+#else
 pref("extensions.formautofill.supportedCountries", "US,CA,DE");
+pref("extensions.formautofill.supportRTL", true);
+#endif
 
 // Whether or not to restore a session with lazy-browser tabs.
 pref("browser.sessionstore.restore_tabs_lazily", true);
 
 pref("browser.suppress_first_window_animation", true);
 
 // Preferences for Photon onboarding system extension
 pref("browser.onboarding.enabled", true);
--- a/browser/extensions/formautofill/bootstrap.js
+++ b/browser/extensions/formautofill/bootstrap.js
@@ -52,21 +52,24 @@ function addUpgradeListener(instanceID) 
   });
 }
 
 function isAvailable() {
   let availablePref = Services.prefs.getCharPref("extensions.formautofill.available");
   if (availablePref == "on") {
     return true;
   } else if (availablePref == "detect") {
-    let locale = Services.locale.getRequestedLocale();
     let region = Services.prefs.getCharPref("browser.search.region", "");
     let supportedCountries = Services.prefs.getCharPref("extensions.formautofill.supportedCountries")
                                            .split(",");
-    return locale == "en-US" && supportedCountries.includes(region);
+    if (!Services.prefs.getBoolPref("extensions.formautofill.supportRTL") &&
+        Services.locale.isAppLocaleRTL) {
+      return false;
+    }
+    return supportedCountries.includes(region);
   }
   return false;
 }
 
 function startup(data) {
   if (!isAvailable()) {
     Services.prefs.clearUserPref("dom.forms.autocomplete.formautofill");
     // reset the sync related prefs incase the feature was previously available