[whatwg] reply() extension to postMessage()

Jonas Sicking jonas at sicking.cc
Sat Mar 1 15:54:59 PST 2008

Ian Hickson wrote:
> On Sat, 1 Mar 2008, Jonas Sicking wrote:
>>> Over the past few days I've been working on something similar:
>>>    http://hixie.ch/specs/dom/messages/0.9
>> So this draft makes one of the two endpoints cross scope, i.e. it is 
>> created in one window, and are then passed over to the other. This is a 
>> major pain security wise. For example, what happens to expando 
>> properties set on the object?
> I updated the proposal recently (in response to similar feedback from Adam 
> or Collin) to say that when you pass an EndPoint through postMessage(), 
> what happens is that a clone EndPoint is made for delivery on the other 
> side, and the EndPoint you passed becomes invalid.

So why bother with having one side create two endpoints just to have one 
made invalid? It intoroduces two more objects (the pair and the second 
endpoint) that the caller basically will just throw away. Wouldn't it be 
better to have one side instead create just one endpoint (though I would 
call it a messagePipe instead) and then make the postMessage 
implementation create the other endpoint.

>> I too am strongly in favor of having synchronous message. Asynchronous 
>> things are in general harder for developers to understand. And while 
>> Synchronous things generally are evil when it comes to network loads, I 
>> see no such problems here.
> Yeah I think postMessage() would be synchronous. It would have to be async 
> when talking across workers, though:
>    http://hixie.ch/specs/dom/workers/0.9


/ Jonas

More information about the whatwg mailing list