tor-browser

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

history-replaceState.html (742B)


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