Is it possible to detect right before the user changes tabs/minimizes?
<p>I know it's possible to detect <a href="http://stackoverflow.com/questions/147636/best-way-to-detect-when-a-user-leaves-a-web-page">right before a user closes a webpage</a> using <code>onbeforeunload</code>. I was just wondering if there was a similar event fired right before the user switches tabs or minimizes. I'm <strong>not looking</strong> for an event that fires after the user changes tabs.</p>

<p>Is this possible?</p>
