<html>
  <head>
    <script>
      function loaded() {
        addEventListener("message", ({ data }) => {
          document.getElementById("form").action = data;
          document.getElementById("button").click();
        }, { once: true });
        opener.postMessage("loaded", "*");
      }
    </script>
  </head>
  <body onload="loaded();">
    <form id="form" method="POST">
      <input id="button" type="submit" />
    </form>
  </body>
</html>
