rem: var ps = window.arguments[0].QueryInterface(gPrintSetInterface); if (ps != null) { gPrintSettings = ps; paramBlock = window.arguments[1].QueryInterface(Components.interfaces.nsIDialogParamBlock); } else { var suppsArray = window.arguments[0].QueryInterface(Components.interfaces.nsISupportsArray); if (suppsArray) { var supps = suppsArray.ElementAt(0); gPrintSettings = supps.QueryInterface(gPrintSetInterface); if(!gPrintSettings) { return; } supps = suppsArray.ElementAt(1); paramBlock = supps.QueryInterface(Components.interfaces.nsIDialogParamBlock); if(!paramBlock) { return; } } else { return; } } 
add: gPrintSettings   = window.arguments[0].QueryInterface(gPrintSetInterface); gWebBrowserPrint = window.arguments[1].QueryInterface(Components.interfaces.nsIWebBrowserPrint); paramBlock       = window.arguments[2].QueryInterface(Components.interfaces.nsIDialogParamBlock); 
context: function onLoad(){  // Init dialog.  initDialog();  // param[0]: nsIPrintSettings object  // param[1]: container for return value (1 = print, 0 = cancel)  var ps = window.arguments[0].QueryInterface(gPrintSetInterface);  if (ps != null) {    gPrintSettings = ps;    paramBlock = window.arguments[1].QueryInterface(Components.interfaces.nsIDialogParamBlock);  } else {    var suppsArray = window.arguments[0].QueryInterface(Components.interfaces.nsISupportsArray);    if (suppsArray) {      var supps = suppsArray.ElementAt(0);      gPrintSettings = supps.QueryInterface(gPrintSetInterface);      if(!gPrintSettings) {        return;      }      supps = suppsArray.ElementAt(1);      paramBlock = supps.QueryInterface(Components.interfaces.nsIDialogParamBlock);      if(!paramBlock) {        return;      }    } else {      return;    }  }  // default return value is "cancel"  paramBlock.SetInt(0, 0);  loadDialog();}
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/15a673155fff62104de022c479b52362163dc8d3/printdialog.js/clean/xpfe/global/resources/content/printdialog.js