rem: referrer = Components.classes["@mozilla.org/network/standard-url;1"] .createInstance(nsCI.nsIURI); referrer.spec = Components.lookupMethod(aOpener,"location") .call(aOpener); 
add: var location = Components.lookupMethod(aOpener,"location") .call(aOpener); var referrer = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService) .newURI(location, null, null);  
context:   openURI : function(aURI, aOpener, aWhere, aContext)  {    var newWindow = null;    var referrer = null;    if (aWhere == nsCI.nsIBrowserDOMWindow.OPEN_DEFAULTWINDOW) {      switch (aContext) {        case nsCI.nsIBrowserDOMWindow.OPEN_EXTERNAL :          aWhere = gPrefService.getIntPref("browser.link.open_external");          break;        default : // OPEN_NEW or an illegal value          aWhere = gPrefService.getIntPref("browser.link.open_newwindow");      }    }    var url = aURI ? aURI.spec : "about:blank";    switch(aWhere) {      case nsCI.nsIBrowserDOMWindow.OPEN_NEWWINDOW :        newWindow = openDialog(getBrowserURL(), "_blank", "all,dialog=no", url);        break;      case nsCI.nsIBrowserDOMWindow.OPEN_NEWTAB :        var newTab = gBrowser.addTab("about:blank");        if (!gPrefService.getBoolPref("browser.tabs.loadDivertedInBackground"))          gBrowser.selectedTab = newTab;        newWindow = gBrowser.getBrowserForTab(newTab).docShell                            .QueryInterface(nsCI.nsIInterfaceRequestor)                            .getInterface(nsCI.nsIDOMWindow);        try {          if (aOpener) {            referrer = Components.classes["@mozilla.org/network/standard-url;1"]                                 .createInstance(nsCI.nsIURI);            referrer.spec = Components.lookupMethod(aOpener,"location")                                      .call(aOpener);          }          newWindow.QueryInterface(nsCI.nsIInterfaceRequestor)                   .getInterface(nsCI.nsIWebNavigation)                   .loadURI(url, nsCI.nsIWebNavigation.LOAD_FLAGS_NONE,                            referrer, null, null);        } catch(e) {        }        break;      default : // OPEN_CURRENTWINDOW or an illegal value        try {          if (aOpener) {            newWindow = Components.lookupMethod(aOpener,"top")                                  .call(aOpener);            referrer = Components.classes["@mozilla.org/network/standard-url;1"]                                 .createInstance(nsCI.nsIURI);            referrer.spec = Components.lookupMethod(aOpener,"location")                                      .call(aOpener);            newWindow.QueryInterface(nsCI.nsIInterfaceRequestor)                     .getInterface(nsIWebNavigation)                     .loadURI(url, nsIWebNavigation.LOAD_FLAGS_NONE, referrer,                              null, null);          } else {            newWindow = gBrowser.selectedBrowser.docShell                                .QueryInterface(nsCI.nsIInterfaceRequestor)                                .getInterface(nsCI.nsIDOMWindow);            loadURI(url, null);          }        } catch(e) {        }    }    return newWindow;  },
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/1ba440ea0eec2fba44c3a7d090114779a2547119/browser.js/buggy/browser/base/content/browser.js