rem: if( navigator.vendor != "Mozilla Sunbird" ) { var navWindow; 
add:  var navWindow; try { var wm = (Components .classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator)); navWindow = wm.getMostRecentWindow("navigator:browser"); } catch (e) { dump("launchBrowser (getMostRecentWindow) exception:\n" + e + "\n"); } if (navWindow) { if ("delayedOpenTab" in navWindow) navWindow.delayedOpenTab(UrlToGoTo); else if ("loadURI" in navWindow) navWindow.loadURI(UrlToGoTo); else navWindow.content.location.href = UrlToGoTo; return; } 
context: function launchBrowser(UrlToGoTo){   if( navigator.vendor != "Mozilla Sunbird" ) {     var navWindow;     // if not, get the most recently used browser window       try {         var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]           .getService(Components.interfaces.nsIWindowMediator);         navWindow = wm.getMostRecentWindow("navigator:browser");       } catch (e) {         dump("launchBrowser: Exception: " + e + "\n");       }          if (navWindow) {       if ("delayedOpenTab" in navWindow)         navWindow.delayedOpenTab(UrlToGoTo);       else if ("loadURI" in navWindow)         navWindow.loadURI(UrlToGoTo);       else         navWindow.content.location.href = UrlToGoTo;     }     // if all else fails, open a new window      else {       var ass = Components.classes["@mozilla.org/appshell/appShellService;1"].getService(Components.interfaces.nsIAppShellService);       w = ass.hiddenDOMWindow;       w.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", UrlToGoTo );     }   }    else     {       try {         var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();         messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);         messenger.launchExternalURL(UrlToGoTo);         } catch (e) {         dump("launchBrowser: Exception: "+e+"\n");       }     }   //window.open(UrlToGoTo, "_blank", "chrome,menubar,toolbar,resizable,dialog=no");   //window.open( UrlToGoTo, "calendar-opened-window" );}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/ea85926a65af4dffe1ff160ea78451966e0888ee/applicationUtil.js/buggy/calendar/resources/content/applicationUtil.js