chromium/third_party/blink/web_tests/external/wpt/content-security-policy/navigate-to/support/form_action_navigation.sub.html

<!DOCTYPE html>
<head>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>

  <script>
    window.addEventListener('securitypolicyviolation', function(e) {
      top.postMessage({result: 'fail', violatedDirective: e.violatedDirective}, '*');
    });
  </script>
</head>

<body>
<form action='{{GET[action]}}' target='_self' id='form'>
  <input type="text" name="dummy">
  <div id="form-div"></div>
</form>

<script>
 try {
  url = new URL("{{GET[action]}}", location.href);
  for (var p of url.searchParams) {
    var elem = document.createElement('input');
    elem.type = 'text';
    elem.name = p[0];
    elem.value = p[1];
    document.getElementById('form-div').appendChild(elem);
  }
 } catch(ex) {}

 document.getElementById('form').submit();
</script>
</body>