W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2007

[whatwg] More on postMessage

From: Krištof Želechovski <giecrilj@stegny.2a.pl>
Date: Thu, 19 Jul 2007 14:53:23 +0200
Message-ID: <009c01c7ca03$cdc60d90$5200a8c0@konst09>

----- Original Message ----- 
From: "Jeff Walden" <jwalden+whatwg@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 
Received on Thursday, 19 July 2007 05:53:23 UTC

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