Inline JSON message response

This commit is contained in:
Kevin Sawicki 2015-12-14 17:09:31 -08:00
parent d1989b3624
commit aa9c7662a3

View file

@ -2,13 +2,12 @@
<body> <body>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
window.addEventListener('message', function (e) { window.addEventListener('message', function (e) {
var reply = JSON.stringify({ window.opener.postMessage(JSON.stringify({
origin: e.origin, origin: e.origin,
data: e.data, data: e.data,
sourceEqualsOpener: e.source === window.opener, sourceEqualsOpener: e.source === window.opener,
sourceId: e.source.guestId sourceId: e.source.guestId
}) }), '*');
window.opener.postMessage(reply, '*');
}); });
</script> </script>
</body> </body>