W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2010

[whatwg] Proposal for a tab visibility API

From: Frank Hellenkamp <jonas@depagecms.net>
Date: Thu, 16 Dec 2010 10:17:12 +0100
Message-ID: <4D09D918.8050101@depagecms.net>
Hi,

>> 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?)

You don't have to track where call was coming from:

1. you just don't let the alert take the focus in windows that are not
visible or
2. you don't show it up at all until the visibility of the window
changes back to visible.

-- 
frank hellenkamp | interface designer
solmsstra?e 7 | 10961 berlin

+49.30.49 78 20 70 | tel
+49.176.32 13 88 89 | mbl
+49.3212.100 35 22 | fax
jonas at depagecms.net

http://depage.net | bureau
http://depagecms.net | content management
http://immerdasgleiche.de | read
http://everydayisexactlythesame.net | see

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20101216/d54a5e51/attachment.pgp>
Received on Thursday, 16 December 2010 01:17:12 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:02 UTC