add:  for (var i = 0; reallyClose && i < numtabs; ++i) { var ds = browser.getBrowserForTab(cn[i]).docShell;  if (ds.contentViewer && !ds.contentViewer.permitUnload()) reallyClose = false; }  
context: function WindowIsClosing(){  var browser = getBrowser();  var numtabs = browser.mTabContainer.childNodes.length;  var reallyClose = true;  if (numtabs > 1) {    var shouldPrompt = pref.getBoolPref("browser.tabs.warnOnClose");    if (shouldPrompt) {      var promptService =        Components.classes["@mozilla.org/embedcomp/prompt-service;1"]                  .getService(Components.interfaces.nsIPromptService);      //default to true: if it were false, we wouldn't get this far      var warnOnClose = {value:true};       var buttonPressed = promptService.confirmEx(window,          gNavigatorBundle.getString('tabs.closeWarningTitle'),          gNavigatorBundle.getFormattedString("tabs.closeWarning", [numtabs]),         (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0)          + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1),            gNavigatorBundle.getString('tabs.closeButton'),            null, null,            gNavigatorBundle.getString('tabs.closeWarningPromptMe'),            warnOnClose);      reallyClose = (buttonPressed == 0);      //don't set the pref unless they press OK and it's false      if (reallyClose && !warnOnClose.value) {        pref.setBoolPref("browser.tabs.warnOnClose", false);      }    } //if the warn-me pref was true  } //if multiple tabs are open  return reallyClose;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/9ccddfc80fa404a16fd3f2c3393ca0d7dd334408/navigator.js/buggy/suite/browser/navigator.js