tor-browser

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

file_iframe_sandbox_window_top_navigation_fail.html (802B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Test for Bug 766282</title>
      6  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
      7 </head>
      8 <script>
      9  function doStuff() {
     10    window.opener.parent.postMessage({ok: false, desc:  "Sandboxed top-level navigation browsing context flag NOT copied to new auxiliary browsing context."}, "*");
     11 
     12    // Check that when no browsing context returned by "target='_top'", a new browsing context isn't opened by mistake.
     13    try {
     14      window.opener.parent.opener.parent.postMessage({ok: false, desc:  "An attempt at top navigation without 'allow-top-navigation' should not have opened a new browsing context."}, "*");
     15    } catch (error) {
     16    }
     17 
     18    self.close();
     19  }
     20 </script>
     21 <body onLoad="doStuff()">
     22 FAIL
     23 </body>
     24 </html>