[whatwg] Proposal for a tab visibility API

Thomas Broyer t.broyer at gmail.com
Fri Dec 10 15:00:44 PST 2010

On Fri, Dec 10, 2010 at 1:14 PM, Dennis Joachimsthaler <dennis at efjot.de> wrote:
> Maybe we can disallow the "visibilitychange" event to produce any dialogs
> or anything else that could give focus?

window.onvisibilitychange = function(e) {
  setTimeout(function() {
    alert("Worked around!");
  }, 0);

Or would browsers be able to track that the code was initially
triggered from visibilitychange? (including when programmatically
creating and dispatching another DOM events, instead of or in addition
to the setTimeout?)

Thomas Broyer

More information about the whatwg mailing list