<!--
  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>
