One of the cool new features in HTML 5 is Cross Document Messaging. What makes this feature really nice is that all the next-generation browsers support it: Internet Explorer 8, Firefox 3, Opera 9, and Safari nightly. Facebook is already using this feature, for example, in order to support web-based instant messaging.

The demo demonstrates how easy it is for two iframes of different origins to talk to each other. In real time, each iframe is passing its own mouse coordinates from the onmousemove event to each other…The basic semantic is to use postMessage() to send data to a window object and the receiving window should register for the “onmessage” event to receive data.

In the demo Austin creates two iframes that communicate using postMessage in order to broadcast the mouse’s coordinates:

Whow ! Really interesting !!
I currently try to realize a communication “tunnel” between webpage and firefox addon using DOM event.
It works but really limited. This concept show me a new way to investigate…

Unfortunately it is in dire need of a new release (coming this weekend, trunk is fixed) because APIs happy changed between browser releases (deciding back and forth wehther postMessage should belong to document or window).

@Malde: I’ve seen your library. Nice work, though I think you should change the name :) BTW, email me at bradneuberg ATATAT g o o g l e . c o m since there might be a breaking change to the Gears cross origin work that might affect your library.

I’m using postMessage as the basis for a inter-window cross-domain RPC implementation. The library is available at Google Code: http://code.google.com/p/pmrpc/ and is being used in a few cool projects.