title: chrome.windows.onRemoved fired after window is closed
body: <p>I am working on a chrome extension and ran into a scenario where chrome window has been created and bunch of listeners are attached to the window which keep monitoring the window. Now if I close the window with cancel button of the browser window, I need to cleanup the listeners and then close the window. </p>
  
  <p>So, I added a listener using <code>chrome.windows.onRemoved.addListener(function(integer windowId) {...});</code>
  <a href="http://developer.chrome.com/extensions/windows.html#event-onRemoved" rel="nofollow">http://developer.chrome.com/extensions/windows.html#event-onRemoved</a>. But here comes the issue.
  If I close the window the flow is <code>[Closing the window]</code> -> <code>[Firing the event]</code> but I would like to have the opposite <code>[Firing the event]</code> -> <code>[Closing the event]</code> so that I can clean up the listeners and then close the window.</p>
  
  <p>Is there something I am missing here?</p>