rem: return ww.getNewAuthPrompter(null); 
add: return ww.getNewAuthPrompter(window); } else if (iid.equals(Components.interfaces.nsIPrompt)) {  var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getService(Components.interfaces.nsIWindowWatcher); return ww.getNewPrompter(window); 
context: calendarManager.prototype.getRemoteCalendarText = function calMan_getRemoteCalendarText( Channel, onResponse, onError ){   var Listener =   {      onStreamComplete: function(loader, ctxt, status, resultLength, result)      {         window.setCursor( "default" );         var calendarStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties");         var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]                                       .getService(Components.interfaces.nsIPromptService);         var retval = false;         if( typeof( result ) != "string" ) //for 1.7 compatibility             result = String.fromCharCode.apply(this, result);         var ch;         try {           ch = loader.request.QueryInterface(Components.interfaces.nsIHttpChannel);         } catch(e) {         }         if (ch && !ch.requestSucceeded) {           promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'),                               calendarStringBundle.formatStringFromName('httpError',[ch.responseStatus, ch.responseStatusText],2));         }         else if (ch && !Components.isSuccessCode(loader.request.status)) {           // XXX this should be made human-readable.           promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'),                               calendarStringBundle.formatStringFromName('otherError',[loader.request.status.toString(16)],1));         }         //check to make sure its actually a calendar file, if not return.         else if( result.indexOf( "BEGIN:VCALENDAR" ) == -1 )         {           promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'),                               calendarStringBundle.formatStringFromName('contentError',[Channel.URI.spec, result],2));         } else {             onResponse( result );             retval = true;         }         if( gNextSubNodeToRefresh )            gCalendarWindow.calendarManager.refreshAllRemoteCalendars();         return retval;      }   }   var notificationCallbacks =   {     // nsIInterfaceRequestor interface     getInterface: function(iid, instance) {       if (iid.equals(Components.interfaces.nsIAuthPrompt)) {         // use the window watcher service to get a nsIAuthPrompt impl         var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]                            .getService(Components.interfaces.nsIWindowWatcher);         return ww.getNewAuthPrompter(null);       }       Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE;       return null;     }   }   Channel.notificationCallbacks = notificationCallbacks;   var myInstance = Components.classes["@mozilla.org/network/stream-loader;1"].createInstance(Components.interfaces.nsIStreamLoader);   dump( "init channel, \nChannel is "+Channel+"\nURL is "+Channel.URI.spec+"\n" );   window.setCursor( "wait" );   myInstance.init( Channel, Listener, null );}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/64e58f45c4b346c3762269fafa8834fa3657299f/calendarManager.js/buggy/calendar/resources/content/calendarManager.js