rem:  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; }  else { 
add:  var messenger; try { var messenger = (Components .classes["@mozilla.org/messenger;1"] .createInstance()); messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger); } catch (e) { dump("launchBrowser (messenger) exception:\n"+e+"\n"); } if (messenger) { messenger.launchExternalURL(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: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/571cbe6e7e6b4424d7a666db540609e57faca0e4/applicationUtil.js/clean/calendar/resources/content/applicationUtil.js