I'm trying to detect when a user switches away from the current browser tab, to another tab. Listening for window.onblur works well in firefox for detecting when the user switches focus to another window, but it doesn't seem to fire when the user switches to another tab. However, it seems that onfocus is fired when switching to the tab in question, from another tab.
Is there a way to detect when the user switches away from the current tab?