[whatwg] Proposal for Links to Unrelated Browsing Contexts

Charlie Reis creis at chromium.org
Tue Jun 19 10:56:37 PDT 2012


On Mon, Jun 18, 2012 at 7:59 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:

> On 6/18/12 6:10 PM, Charlie Reis wrote:
>
>> I'm going to go out on a limb and say that it's ok if named but
>> unrelated windows are able to discover each other.
>>
>
> I actually don't; I think the fact that it happens in Firefox is a
> (longstanding) bug that needs to get fixed.
>
>
>  If we want to change that behavior and make all window names be specific
>> to their unit of related browsing contexts
>>
>
> I believe the spec already does that, actually.
>
> -Boris
>

Here's what I see in the spec:
http://dev.w3.org/html5/spec/single-page.html#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name

"4. If the given browsing context name is not _blank and there exists a
browsing context whose name is the same as the given browsing context name,
and the current browsing context is allowed to navigate that browsing
context, and the user agent determines that the two browsing contexts are
related enough that it is ok if they reach each other, then that browsing
context must be the chosen one. If there are multiple matching browsing
contexts, the user agent should select one in some arbitrary consistent
manner, such as the most recently opened, most recently focused, or more
closely related."

This says that any two windows that are "allowed to navigate" each other
(e.g., same origin or a few other conditions from
http://dev.w3.org/html5/spec/single-page.html#allowed-to-navigate) are
permitted to find each other.  That's from the "[if] the user agent
determines that the two browsing contexts are related enough that it is ok
if they reach each other" part, which is quite vague.

I wouldn't mind seeing that change in a separate proposal, but the spec
seems like it matches the current behavior of browsers.  Were you referring
to a different clause?

I'll also note that this behavior does indeed seem specific to windows that
are "allowed to navigate" each other, at least in Chrome, Safari, Opera,
and IE.  Firefox appears to allow cross-origin windows find each other by
name.  Perhaps that's the bug you're referring to?

Charlie



More information about the whatwg mailing list