tor-browser

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

file_iframe_sandbox_e_if16.html (901B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Tests for Bug 838692</title>
      6  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
      7 </head>
      8 
      9 <script>
     10  var testContext = "Test 26: navigate top by name with window.open(): ";
     11 
     12  function doTest() {
     13    try {
     14      var topsOpener = window.top.opener;
     15      window.open("file_iframe_sandbox_top_navigation_fail.html?" + escape(testContext), "e_if15");
     16      topsOpener.postMessage({ok: false, desc: unescape(testContext) + "top navigation should NOT be allowed by a document sandboxed without 'allow-top-navigation.'"}, "*");
     17    } catch(error) {
     18      window.top.opener.postMessage({ok: true, desc: testContext + "as expected, error thrown during window.open(..., \"e_if15\")"}, "*");
     19      window.top.close();
     20    }
     21  }
     22 </script>
     23 
     24 <body onload="doTest()">
     25  I am sandboxed but with "allow-scripts"
     26 </body>
     27 </html>