Since it was released nearly a year ago, many people have found Porthole useful to overcome the inherent browser limitation when needing to communicate with cross domain iframe in a secure fashion.

Porthole has now been updated to support arbitrary Javascript objects instead of just string messages. This means that you can exchange a hash, array, etc. for richer communication. The objects are serialized as JSON string and automatically de-serialized when passed to your registered listener.

Please note that the method for sending messages has now changed.

Before you invoked

windowProxy.postMessage('supersizeme');

Now you can simply call

windowProxy.post({ supersizeme : true });

with any kind of data structure.

Because of the serialization, the library relies on a JSON parser, which means that older browsers will require an include of JSON.js

For more information, head over to the Porthole project page or fork it on Github.