W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2009

[whatwg] Inter-window communication beyond window.postMessage()

From: Drew Wilson <atwilson@google.com>
Date: Mon, 14 Sep 2009 09:48:45 -0700
Message-ID: <f965ae410909140948u14d5669ev278142a462a1319f@mail.gmail.com>
Agreed - I've always felt like having to have a reference to a window would
be an obstacle.
I feel obliged to point out that cross-domain SharedWorkers might be another
option for two completely unrelated windows to interact, although the
suggestions I've heard for APIs for x-domain access seem to center around
CORS, which may or may not be sufficient for this type of case.
-atw

On Mon, Sep 14, 2009 at 7:36 AM, Sidney San Mart?n <s at sidneysm.com> wrote:

> The cross-document messaging API solves a lot of problems and is overall an
> Awesome Thing, but requiring a reference to the target window is hugely
> limiting. When a a window wants to talk to another window and didn't create
> it, there are basically three options:
>
> 1. window.open with a window name argument, which is a hack because the
> target window has to reload.
> 2. Comet, which is a horrible hack because a trip to the server is
> required.
> 3. LocalStorage and storage events, which wasn't designed for anything
> remotely like this.
>
> Unless there's a reason to prevent free communication between windows,
> there must be a better solution. I can think of a couple of possibilities.
> The most obvious one would be an API similar to postMessage that allows
> broadcasting of messages to all windows, windows by name, and windows by
> domain. Another one (which I haven't developed very far) would be to stick
> with window.postMessage but provide an API to ask for windows. So, I could
> say, "Can I please have a reference to the window named 'x'", or, "...to
> windows at 'example.com'", or, "...to any window who'll give me one". Each
> window would obviously have to opt into this.
>
> What do you all think?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090914/a7be1d16/attachment-0001.htm>
Received on Monday, 14 September 2009 09:48:45 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:52 UTC