summaryrefslogtreecommitdiffstats
path: root/dom/indexedDB/test/third_party_window.html
blob: 20d453d7a3892432a138167be482c264b8424573 (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", () => {
          iframe.contentWindow.postMessage(JSON.stringify(evt.data), "*");
        });

        return;
      }

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

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

</html>