Tor Browser bundle restores focus to window when tor restarts

On Mac OS X 10.8.x (but I have also seen it in previous versions of it), when Tor reconnects the window and space containing the Tor browser bundle will have focus to it restored.

Steps to reproduce:

  • Start TBB
  • Disconnect from the network
  • Go to a space different than the one where TBB is in
  • Wait for Tor to automatically reconnect
  • Focus is restored to the TBB space

I believe this is quite a serious anonymity leak because if you restore your laptop from sleep and are showing something to somebody it will unexpectedly switch to your torbrowser all of a sudden.