rem: var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var win = wm.getMostRecentWindow("navigator:browser"); 
add: var win; if (document.documentElement.instantApply) {  var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); win = wm.getMostRecentWindow("navigator:browser"); } else win = window.opener;  
context:   setHomePageToCurrentPage: function ()  {    var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]                      .getService(Components.interfaces.nsIWindowMediator);    var win = wm.getMostRecentWindow("navigator:browser");    if (win) {      var homePageField = document.getElementById("browserStartupHomepage");      var newVal = "";      var tabbrowser = win.document.getElementById("content");      var l = tabbrowser.browsers.length;      for (var i = 0; i < l; i++) {        if (i)          newVal += "|";        newVal += tabbrowser.getBrowserAtIndex(i).webNavigation.currentURI.spec;      }            homePageField.value = newVal;      this._pane.userChangedValue(homePageField);    }  },
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/9c2defff3303034a7df868247ccf5832aabfc176/general.js/buggy/browser/components/preferences/general.js