Is there any way to detect that the window is currently active (is being shown on active tab/window) in IE8?

I know there are events like onfocusin/onfocus - but this is not a perfect solution, since the window must also receive focus for the event to be fired - so this does not work when the user just switches the tabs without touching the window itself.

I believe there has to be some simple, elegant solution for such ordinary use-case.

Edit
Report