tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

navigate-form-get.html (984B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <form id="form" action=""></form>
      5 <script>
      6 async_test(t => {
      7  navigation.onnavigate = t.step_func_done(e => {
      8    e.preventDefault();
      9 
     10    assert_equals(e.navigationType, "replace");
     11    assert_true(e.cancelable);
     12    assert_true(e.canIntercept);
     13    assert_false(e.userInitiated);
     14    assert_false(e.hashChange);
     15    assert_equals(e.downloadRequest, null);
     16    assert_equals(e.destination.url, location.href + "?");
     17    assert_false(e.destination.sameDocument);
     18    assert_equals(e.destination.key, "");
     19    assert_equals(e.destination.id, "");
     20    assert_equals(e.destination.index, -1);
     21 
     22    // Because it's a GET, not a POST
     23    assert_equals(e.formData, null);
     24    assert_equals(e.sourceElement, form);
     25  });
     26  window.onload = t.step_func(() => form.submit());
     27 }, "<form> submission with GET method fires navigate event but with formData null");
     28 </script>