Bug 1419312 - Expand supported locales and countries on Nightly and Beta. r=lchang draft
authorScott Wu <scottcwwu@gmail.com>
Mon, 15 Jan 2018 18:31:08 +0800
changeset 721537 b39f17abf6d75f52710d6480029749e9297d5856
parent 720191 21ddfb9e6cc008e47da89db50e22697dc7b38635
child 746355 936a749f5f5c2238f019f775b7744f3a026d7293
push id95859
push userbmo:scwwu@mozilla.com
push dateWed, 17 Jan 2018 11:07:26 +0000
reviewerslchang
bugs1419312
milestone59.0a1
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