var a = new BroadcastChannel('a'); var b = new BroadcastChannel('a'); a.onmessage = function(e) { parent.postMessage(e.data, "*"); }; b.postMessage(42);