diff --git a/suite/common/pref/pref-navigator.js b/suite/common/pref/pref-navigator.js index 054da3d008d..809d8b0e4b6 100644 --- a/suite/common/pref/pref-navigator.js +++ b/suite/common/pref/pref-navigator.js @@ -4,9 +4,12 @@ const nsIFilePicker = Components.interfaces.nsIFilePicker; const nsIWindowMediator = Components.interfaces.nsIWindowMediator; +const nsIPrefService = Components.interfaces.nsIPrefService; +const nsIPrefLocalizedString = Components.interfaces.nsIPrefLocalizedString; const FILEPICKER_CONTRACTID = "@mozilla.org/filepicker;1"; const WINDOWMEDIATOR_CONTRACTID = "@mozilla.org/appshell/window-mediator;1"; +const PREFSERVICE_CONTRACTID = "@mozilla.org/preferences-service;1"; function selectFile() { @@ -42,3 +45,16 @@ function setHomePageToCurrentPage() } } } + +function setHomePageToDefaultPage() +{ + var prefService = Components.classes[PREFSERVICE_CONTRACTID] + .getService(nsIPrefService); + var pref = prefService.getDefaultBranch(null); + var url = pref.getComplexValue("browser.startup.homepage", + nsIPrefLocalizedString).data; + var homePageField = document.getElementById("browserStartupHomepage"); + homePageField.value = url; +} + + \ No newline at end of file diff --git a/suite/common/pref/pref-navigator.xul b/suite/common/pref/pref-navigator.xul index 0e275295b21..2522095d48d 100644 --- a/suite/common/pref/pref-navigator.xul +++ b/suite/common/pref/pref-navigator.xul @@ -39,7 +39,7 @@ var _elementIDs = ["startupPage", "browserStartupHomepage", "bookmarksButton", "goButton", "homeButton", "printButton", - "searchButton" ]; + "searchButton"]; ]]> @@ -75,6 +75,10 @@ oncommand="selectFile();" id="browserChooseFile" prefstring="pref.browser.homepage.disable_button.select_file"/> +