tor-browser

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

navigate-anchor-download-userInitiated.html (1153B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script src="/resources/testdriver.js"></script>
      5 <script src="/resources/testdriver-vendor.js"></script>
      6 <script src="/resources/testdriver-actions.js"></script>
      7 <a id="a" href="?1">Click me</a>
      8 <script>
      9 async_test(t => {
     10  a.download = "";
     11  navigation.onnavigate = t.step_func(e => {
     12    assert_equals(e.navigationType, "push");
     13    assert_true(e.cancelable);
     14    assert_true(e.canIntercept);
     15    assert_true(e.userInitiated);
     16    assert_false(e.hashChange);
     17    assert_equals(e.downloadRequest, "");
     18    assert_equals(e.formData, null);
     19    assert_equals(new URL(e.destination.url).search, "?1");
     20    assert_false(e.destination.sameDocument);
     21    assert_equals(e.destination.key, "");
     22    assert_equals(e.destination.id, "");
     23    assert_equals(e.destination.index, -1);
     24    assert_equals(e.sourceElement, document.getElementById("a"));
     25    e.preventDefault();
     26    t.step_timeout(t.step_func_done(() => assert_equals(location.hash, "")), 0);
     27  });
     28  test_driver.click(a);
     29 }, "<a download> click fires navigate event");
     30 </script>