I'd like to track when a certain web-page is (or is not) in the foreground.
I've already experimented with the Page Visibility API, and I can use it to find out if my page is the currently active tab of its window. But I also need to know when my page's window is not in the foreground (despite being the active one of that window).
Is this something I can detect using javascript?