rem: var windowManager = Components.classes[WINDOWMEDIATOR_CONTRACTID] .getService(nsIWindowMediator);  var browserWindow = windowManager.getMostRecentWindow("navigator:browser"); if (browserWindow) { var browser = browserWindow.document.getElementById("content"); var url = browser.webNavigation.currentURI.spec; if (url) { var homePageField = document.getElementById("browserStartupHomepage"); homePageField.value = url; } 
add: var url = getCurrentPage(); if (url) { var homePageField = document.getElementById("browserStartupHomepage"); homePageField.value = url; 
context: function setHomePageToCurrentPage(){  var windowManager = Components.classes[WINDOWMEDIATOR_CONTRACTID]                                .getService(nsIWindowMediator);  var browserWindow = windowManager.getMostRecentWindow("navigator:browser");  if (browserWindow) {    var browser = browserWindow.document.getElementById("content");    var url = browser.webNavigation.currentURI.spec;    if (url) {      var homePageField = document.getElementById("browserStartupHomepage");      homePageField.value = url;    }  }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/e25635a6a8a3e2a7cc50f68ecd54b658fab4b7e5/pref-navigator.js/buggy/xpfe/components/prefwindow/resources/content/pref-navigator.js