summaryrefslogtreecommitdiffstats
path: root/application/palemoon/components/preferences/tabs.js
diff options
context:
space:
mode:
authorJustOff <Off.Just.Off@gmail.com>2019-03-26 01:27:46 +0200
committerJustOff <Off.Just.Off@gmail.com>2019-03-26 01:27:46 +0200
commita15e49e4269f34afaa1f37092332e134d9b9b711 (patch)
tree67c353ce808d67226a1d35928a089f76533b8e9f /application/palemoon/components/preferences/tabs.js
parentaa816b3d848d38c83204c3dd1a1d0b86013978b4 (diff)
downloadUXP-a15e49e4269f34afaa1f37092332e134d9b9b711.tar
UXP-a15e49e4269f34afaa1f37092332e134d9b9b711.tar.gz
UXP-a15e49e4269f34afaa1f37092332e134d9b9b711.tar.lz
UXP-a15e49e4269f34afaa1f37092332e134d9b9b711.tar.xz
UXP-a15e49e4269f34afaa1f37092332e134d9b9b711.zip
Prevent mistaken overwriting of browser.newtab.url when using the browser preferences dialog
Diffstat (limited to 'application/palemoon/components/preferences/tabs.js')
-rw-r--r--application/palemoon/components/preferences/tabs.js29
1 files changed, 4 insertions, 25 deletions
diff --git a/application/palemoon/components/preferences/tabs.js b/application/palemoon/components/preferences/tabs.js
index 17084a770..b09cb60df 100644
--- a/application/palemoon/components/preferences/tabs.js
+++ b/application/palemoon/components/preferences/tabs.js
@@ -78,34 +78,13 @@ var gTabsPane = {
/**
* Determines the value of the New Tab display drop-down based
* on the value of browser.newtab.url.
- *
- * @returns the appropriate value of browser.newtab.choice
*/
readNewtabUrl: function() {
- let newtabUrlPref = document.getElementById("browser.newtab.url");
- let newtabUrlSanitizedPref = document.getElementById("browser.newtab.myhome");
let newtabUrlChoice = document.getElementById("browser.newtab.choice");
- let defaultStartupHomepage = Services.prefs.getDefaultBranch("browser.")
- .getComplexValue("startup.homepage",
- Components.interfaces.nsIPrefLocalizedString).data;
- switch (newtabUrlPref.value) {
- case "about:logopage":
- newtabUrlChoice.value = 1;
- break;
- case defaultStartupHomepage:
- newtabUrlChoice.value = 2;
- break;
- case newtabUrlSanitizedPref.value:
- newtabUrlChoice.value = 3;
- break;
- case "about:newtab":
- newtabUrlChoice.value = 4;
- break;
- default: // Custom URL entered.
- document.getElementById("newtabPageCustom").hidden = false;
- newtabUrlChoice.value = 0;
- // We need this to consider instantApply.
- this.newtabPageCustom = newtabUrlPref.value;
+ newtabUrlChoice.value = gNewtabUrl.getNewtabChoice();
+ if (newtabUrlChoice.value == 0) {
+ document.getElementById("newtabPageCustom").hidden = false;
}
+ gNewtabUrl.newtabUrlChoiceIsSet = true;
}
};