Use the default value from 'browser.startup.homepage' instead of the hardcoded 'http://start.palemoon.org/'

This commit is contained in:
JustOff 2018-09-03 23:27:30 +03:00 committed by Roy Tam
commit 758922c244
2 changed files with 7 additions and 2 deletions

View file

@ -42,7 +42,9 @@ var gNewtabUrl = {
newtabUrlPref = "about:logopage";
break;
case 2:
newtabUrlPref = "http://start.palemoon.org/";
newtabUrlPref = Services.prefs.getDefaultBranch("browser.")
.getComplexValue("startup.homepage",
Components.interfaces.nsIPrefLocalizedString).data;
break;
case 3:
// If url is a pipe-delimited set of pages, just take the first one.

View file

@ -85,11 +85,14 @@ var gTabsPane = {
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 "http://start.palemoon.org/":
case defaultStartupHomepage:
newtabUrlChoice.value = 2;
break;
case newtabUrlSanitizedPref.value: