[whatwg] Proposal for a tab visibility API

Frank Hellenkamp jonas at depagecms.net
Thu Dec 16 01:17:12 PST 2010


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-0002.pgp>


More information about the whatwg mailing list