summaryrefslogtreecommitdiffstats
path: root/dom/messagechannel/tests/iframe_messageChannel_post.html
blob: 846b247f0b6a214f59817e8d8bc93588d05dc9ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE HTML>
<html>
<body>
  <script type="application/javascript">

  var port;

  window.addEventListener('message', receiveMessage);
  function receiveMessage(evt) {
    port = evt.data.port;

    port.addEventListener('message', receivePostMessage);
    function receivePostMessage(event) {
      port.postMessage(event.data);
    }
    port.start();

    window.parent.postMessage({ status: "READY" }, '*');
  }

  </script>
</body>
</html>