Inline JSON message response
This commit is contained in:
parent
d1989b3624
commit
aa9c7662a3
1 changed files with 2 additions and 3 deletions
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue