tor-browser

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

location-api.html (719B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script>
      5 test(t => {
      6  let start_index = navigation.currentEntry.index;
      7 
      8  let oncurrententrychange_called = false;
      9  let original_entry = navigation.currentEntry;
     10  navigation.oncurrententrychange = t.step_func(e => {
     11    oncurrententrychange_called = true;
     12    assert_equals(e.from, original_entry);
     13    assert_equals(e.from.index, -1);
     14    assert_equals(e.navigationType, "replace");
     15    assert_equals(navigation.currentEntry.index, start_index);
     16  });
     17  location.hash = "#foo";
     18  assert_true(oncurrententrychange_called);
     19 }, "currententrychange fires for location API navigations");
     20 </script>