Event-like api for postMessage to send objects between cross-domain frames