tor-browser

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

history-pushState.html (657B)


      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  navigation.oncurrententrychange = t.step_func(e => {
     10    oncurrententrychange_called = true;
     11    assert_equals(e.from, navigation.entries()[start_index]);
     12    assert_equals(e.navigationType, "push");
     13    assert_equals(navigation.currentEntry.index, start_index + 1);
     14  });
     15  history.pushState(1, "", "#1");
     16  assert_true(oncurrententrychange_called);
     17 }, "currententrychange fires for history.pushState()");
     18 </script>