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

[whatwg] using postMessage() to send to a newly-created window

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 5 Jan 2010 17:03:44 -0800
Message-ID: <63df84f1001051703m2e8c76efj92fae47e10fac386@mail.gmail.com>
On Tue, Jan 5, 2010 at 5:00 PM, Darin Fisher <darin at chromium.org> wrote:
> The window doesn't open synchronously, so you should have to wait for
> http://x/ to load (or for its document to at least be created) before you
> can start communicating with it.
> Note: If you instead open "about:blank" you should be able to communicate
> with it synchronously since "about:blank" is loaded synchronously. ?It is
> special-cased.
> From the newly opened window, you could try posting a message to its opener.
> ?The opener could then handle that event and use it as a signal to know that
> it can know begin communicating with the newly opened window.
> I haven't tested any of this ;-)

This is a sort of suboptimal state of affairs though. Compare to
workers, which also do not load synchronously, but which you can
immediately send messages to using postMessage().

We could use a similar solution for windows postMessage as we use for
worker postMessage.

The main question is if that would break existing content.

/ Jonas
Received on Tuesday, 5 January 2010 17:03:44 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:20 UTC