summaryrefslogtreecommitdiffstats
path: root/dom/security/test/csp/file_child-src_inner_frame.html
blob: f0c4e66fa0e0b63f29a44da0659e08c21d7f8685 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE HTML>
<html>
  <head>
    <title>Bug 1045891</title>
  </head>
  <body>
    <iframe id="innermosttestframe"> </iframe>
  <script type="text/javascript">
    page_id = window.location.hash.substring(1);

    function recvMessage(ev) {
      if (ev.data.id == page_id) {
        window.parent.postMessage({id:ev.data.id, message:'allowed'}, 'http://mochi.test:8888');
        window.removeEventListener('message', recvMessage);
      }
    }

    window.addEventListener('message', recvMessage);
  </script>
  </body>
</html>