So far I\'ve only seen tutorials for postmessage where one window sends a single kind of message, and the other window interprets the message in only a single way.
What
I recently faced the same problem. After hours of searching i came across post-robot. It's developed by paypal
and solved most of my problems including having a callback for postMessage
.
It also supports passing functions inside the payload.
You can check out the introduction here Introducing post-robot