add:   if (!gTempFile) { const nsIFile = Components.interfaces.nsIFile; var dirService = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties); gTempFile = dirService.get("TmpD", nsIFile); gTempFile.append("calendarPrint.html"); gTempFile.createUnique(nsIFile.NORMAL_FILE_TYPE, 0600); dump("tf: "+gTempFile.path+"\n"); var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var gTempUri = ioService.newFileURI(gTempFile); }  var stream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream);  stream.init(gTempFile, 0x2A, 0600, 0); stream.write(gHtmlString, gHtmlString.length);  gHtmlDocument.location.href = gTempUri.spec; 
context: function OnLoadPrintEngine(){  gContent = document.getElementById("content") ;  if ( window.arguments && window.arguments[0] != null ) {    HTMLViewFunction =  window.arguments[0] ;    HTMLFunctionArgs =  window.arguments[1] ;    gMyTitle = window.arguments[2] ;    gShowprivate = window.arguments[3] ;    gArgs = window.arguments[4] ;    gCalendarWindow = window.arguments[5] ;    eventSource=gArgs.eventSource;    weeksInView=gArgs.weeksInView;    prevWeeksInView=gArgs.prevWeeksInView;    startOfWeek=gArgs.startOfWeek;    gHtmlDocument = window.content.document ;    initHTMLView();    eval(HTMLViewFunction)(HTMLFunctionArgs);    finishHTMLView() ;  }  BrowserPrintPreview();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/839d1ab472eb5db169c081e23508d49439284a18/calPrintEngine.js/clean/calendar/resources/content/calPrintEngine.js