Bug 493527 - Directly change the remember-history pref through the preference element since setting it through the checkbox required multiple attempts. r=jaws draft
authormaxim <maxim@cliqz.com>
Thu, 23 Mar 2017 14:15:33 -0400
changeset 503887 5e3277e71e771b13179b60f77352e8a5bea56d5d
parent 503825 439ee2e4fc4ed4a82102608639d9751e376d5536
child 503958 eaa35600ae3ee9ec4fccfef89b3601bead9d189d
push id50692
push userbmo:jaws@mozilla.com
push dateThu, 23 Mar 2017 18:23:07 +0000
reviewersjaws
bugs493527
milestone55.0a1
Bug 493527 - Directly change the remember-history pref through the preference element since setting it through the checkbox required multiple attempts. r=jaws This looks to be happening because the binding for the checkbox may get torn down too fast when a restart is required. MozReview-Commit-ID: 1y68jMubATx
browser/components/preferences/in-content-old/privacy.js
browser/components/preferences/in-content/privacy.js
--- a/browser/components/preferences/in-content-old/privacy.js
+++ b/browser/components/preferences/in-content-old/privacy.js
@@ -326,19 +326,17 @@ var gPrivacyPane = {
   updateHistoryModePrefs() {
     let pref = document.getElementById("browser.privatebrowsing.autostart");
     switch (document.getElementById("historyMode").value) {
     case "remember":
       if (pref.value)
         pref.value = false;
 
       // select the remember history option if needed
-      let rememberHistoryCheckbox = document.getElementById("rememberHistory");
-      if (!rememberHistoryCheckbox.checked)
-        rememberHistoryCheckbox.checked = true;
+      document.getElementById("places.history.enabled").value = true;
 
       // select the remember forms history option
       document.getElementById("browser.formfill.enable").value = true;
 
       // select the allow cookies option
       document.getElementById("network.cookie.cookieBehavior").value = 0;
       // select the cookie lifetime policy option
       document.getElementById("network.cookie.lifetimePolicy").value = 0;
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -326,19 +326,17 @@ var gPrivacyPane = {
   updateHistoryModePrefs() {
     let pref = document.getElementById("browser.privatebrowsing.autostart");
     switch (document.getElementById("historyMode").value) {
     case "remember":
       if (pref.value)
         pref.value = false;
 
       // select the remember history option if needed
-      let rememberHistoryCheckbox = document.getElementById("rememberHistory");
-      if (!rememberHistoryCheckbox.checked)
-        rememberHistoryCheckbox.checked = true;
+      document.getElementById("places.history.enabled").value = true;
 
       // select the remember forms history option
       document.getElementById("browser.formfill.enable").value = true;
 
       // select the allow cookies option
       document.getElementById("network.cookie.cookieBehavior").value = 0;
       // select the cookie lifetime policy option
       document.getElementById("network.cookie.lifetimePolicy").value = 0;