W3C home > Mailing lists > Public > public-device-apis@w3.org > September 2010

window.open() and popup blockers (was: Agenda - Distributed Meeting 2010-09-29)

From: Anssi Kostiainen <anssi.kostiainen@nokia.com>
Date: Wed, 29 Sep 2010 20:57:23 +0300
Cc: "public-device-apis@w3.org WG" <public-device-apis@w3.org>, "Hirsch Frederick (Nokia-CIC/Boston)" <Frederick.Hirsch@nokia.com>
Message-Id: <32CD93DF-5927-41F7-ADB5-4E8F4ABB098C@nokia.com>
To: ext Ilkka Oksanen <Ilkka.Oksanen@nokia.com>, ext Rich Tibbett <richt@opera.com>
Hi,

On 29.9.2010, at 18.30, ext Ilkka Oksanen wrote:

> 29/09/2010 01:58, ext Rich Tibbett kirjoitti:
>> It's similar to window.open() and browser popup blockers. If 
>> window.open() is called inline then the user is notified that the 
>> popup was blocked. If window.open() is called via a user-initiated 
>> click event, the popup is opened directly.
>> 
> 
> Do you know if this window.open() behavior is specified somewhere? Or
> is it completely implementation specific?

Prior to HTML5 window.open() was part of DOM Level 0, i.e. something implemented by Netscape back in the Dark Ages :)

The HTML5 spec seem to only say how to detect a blocked window [1]: "The [open()] method must return the WindowProxy object of the browsing context that was navigated, or null if no browsing context was navigated".

The spec does not seem to whitelist any user-initiated events or say anything about script-initiated invocation. Mozilla whitelists change, click, dblclick, mouseup, reset and submit events by default, these can be configured via about:config > dom.popup_allowed_events [2]. IE6 whitelists click and focus, also user configurable to some extend [3]. Not sure about the rest of the browsers. Is Opera's implementation similar to Mozilla's?

Looks like this is implementation specific and cannot be relied on if left unspecified. Any ideas how to route around this?

> I think the proposal is applicable to the Capture API and its native
> audio/video recorder as well.

-Anssi

[1] http://dev.w3.org/html5/spec/Overview.html#dom-open
[2] http://kb.mozillazine.org/Dom.popup_allowed_events
[3] http://msdn.microsoft.com/en-us/library/ms537632%28v=vs.85%29.aspx
Received on Wednesday, 29 September 2010 17:59:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:14:13 GMT