tor-browser

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

sandboxing-navigate-sibling.html (836B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <iframe id="i" src="/common/blank.html" sandbox="allow-same-origin"></iframe>
      5 <iframe id="i2" src="resources/navigate-sibling.html" sandbox="allow-scripts allow-same-origin"></iframe>
      6 
      7 <script>
      8 async_test(t => {
      9  window.onload = t.step_func(() => {
     10    i2.contentWindow.navigateSibling();
     11 
     12    i.onload = t.step_func_done(() => {
     13      const destinationURL = (new URL("/common/blank.html?2", location.href)).href;
     14      assert_equals(i.contentWindow.location.href, destinationURL);
     15      assert_equals(i.contentWindow.navigation.currentEntry.url, destinationURL);
     16    });
     17  });
     18 }, "A sandboxed iframe can use its parent's navigation object to call navigate(), as long as allow-same-origin is present");
     19 </script>