tor-browser

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

navigate-cross-origin-iframe-to-same-url.html (826B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script src="/common/get-host-info.sub.js"></script>
      5 <body>
      6 <script>
      7 async_test(t => {
      8  let starting_history_length = history.length;
      9  let cross_origin_url = new URL(get_host_info().HTTPS_REMOTE_ORIGIN);
     10  cross_origin_url.pathname = "/common/blank.html";
     11  let i = document.createElement("iframe");
     12  i.src = cross_origin_url;
     13  document.body.appendChild(i);
     14 
     15  window.onload = () => t.step_timeout(() => {
     16    assert_equals(starting_history_length, history.length);
     17    i.onload = t.step_func_done(() => assert_equals(starting_history_length + 1, history.length));
     18    i.src = cross_origin_url;
     19  }, 0);
     20 }, "Navigating a cross-origin iframe to its current url should not replace");
     21 </script>
     22 </body>