summaryrefslogtreecommitdiffstats
path: root/dom/indexedDB/test/third_party_window.html
blob: 14b16bf5d4998e2e14294acc8084bdb16d14fa7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!--
  Any copyright is dedicated to the Public Domain.
  http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<head>
  <title>Indexed Database Test</title>
  <script type="text/javascript">
    let init = false;
    onmessage = evt => {
      if (!init) {
        init = true;

        let iframe = document.getElementById("iframe1");
        iframe.src = evt.data.iframeUrl;

        iframe.addEventListener("load", e => {
          iframe.contentWindow.postMessage(JSON.stringify(evt.data), "*");
        });

        return;
      }

      opener.postMessage(evt.data, "*");
    };
  </script>
</head>

<body>
  <iframe id="iframe1"></iframe>
</body>

</html>