So there's this relatively new facility provided by most browsers called the Page Visibility API, wherein pages can tell when they're actually visible. Lots of sites have taken advantage of this not to reduce load or shut up when they're not being dealt with or other good stuff, but to enforce their requirement that you look at them before they'll do something you wanted them to do. Usually for a minimum amount of time, as well — a whole new level of forced ads. I imagine a lot of them also use this to further intrude on my privacy by tracking my behavior even more finely than before.
In short: how can I disable this mess? How can I have the browser pretend to the page that it's always visible (or, perhaps, always hidden, or maybe even that the API simply isn't implemented)? On a per-site basis would be ideal, but a simple global setting would be more than welcome as well.
I'm particularly interested in Firefox, but I think we'd all like to know for other browsers too.