rem: document.documentElement.destroy(); 
add: var basewin = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIWebNavigation) .QueryInterface(Components.interfaces.nsIDocShellTreeItem) .treeOwner .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIBaseWindow); basewin.destroy(); 
context: function CloseWindow(){  // Check to make sure document is saved. "true" means allow "Don't Save" button,  //   so user can choose to close without saving  if (CheckAndSaveDocument("cmd_close", true))   {    if (window.InsertCharWindow)      SwitchInsertCharToAnotherEditorOrClose();    //window.editorShell.CloseWindowWithoutSaving();    try {      document.documentElement.destroy();    } catch (e) {}  }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/1d64a2ee98326db2281c557297a79c084c02a4ea/ComposerCommands.js/buggy/editor/ui/composer/content/ComposerCommands.js