[whatwg] More on postMessage
Krištof Želechovski
giecrilj at stegny.2a.pl
Thu Jul 19 05:53:23 PDT 2007
----- Original Message -----
From: "Jeff Walden" <jwalden+whatwg at MIT.EDU>
To: "Gorm Haug Eriksen" <gormer at opera.com>
Cc: <whatwg at whatwg.org>
Sent: Monday, July 16, 2007 9:17 PM
Subject: Re: [whatwg] More on postMessage
> I'll agree that calling postMessage on the other window feels like a
> better and more intuitive API for users, but if implementers have to make
> such invasive and potentially-unsafe changes to do it, I think it's the
> wrong way to do it.
>
How come? "otherWindow.postMessage(M)" translates to AppleScript "tell
otherWindow to post message M". It is not what you want to do here. You
can either "tell thisWindow to post message M to otherWindow"-which is good
because thisWindow can intercept the message and handle the fact that you
are trying to post according to an event handler that may be attached-or
"tell otherWindow to receive message M from thisWindow" which is wrong
because thisWindow is unaware that you pretend it is posting a message. If
you follow this path nevertheless, you should call it receiveMessage, not
postMessage.
Best regards
Chris
More information about the whatwg
mailing list