// In the parent frame window.addEventListener("message", function(evt) { var data; console.debug("Got message: ", evt); data = JSON.parse(evt.data); // Do something... }, false); // In the child frame window.parent.postMessage(JSON.stringify({action: "doSomething", args: {foo: "1}}), "*");