chromium/third_party/blink/web_tests/external/wpt/infrastructure/assumptions/resources/fetch-and-post-result.html

<script>
  window.addEventListener("message", function (event) {
    fetch(event.data)
      .then(response => {
        parent.postMessage(`success: status = ${response.status}`, "*");
      })
      .catch(error => {
        parent.postMessage(`failure: error = ${error.name}`, "*")
      });
  });
</script>