tor-browser

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

file_iframe_sandbox_h_if1.html (1189B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Tests for Bug 766282</title>
      6  <script src="/tests/SimpleTest/EventUtils.js"></script>
      7  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
      8 
      9 </head>
     10 <script type="text/javascript">
     11  function ok(result, desc) {
     12    window.parent.ok_wrapper(result, desc);
     13  }
     14 
     15  function doStuff() {
     16    // Try to open a new window via target="_blank", target="BC766282" and window.open().
     17    // The window we try to open closes itself once it opens.
     18    sendMouseEvent({type:'click'}, 'target_blank');
     19    sendMouseEvent({type:'click'}, 'target_BC766282');
     20 
     21    try {
     22      window.open("file_iframe_sandbox_open_window_pass.html");
     23    } catch(e) {
     24      ok(false, "Test 3: iframes sandboxed with allow-popups, should be able to open windows");
     25    }
     26  }
     27 </script>
     28 <body onLoad="doStuff()">
     29  I am sandboxed but with "allow-popups allow-scripts allow-same-origin"
     30 
     31  <a href="file_iframe_sandbox_open_window_pass.html" target="_blank" rel="opener" id="target_blank">open window</a>
     32  <a href="file_iframe_sandbox_open_window_pass.html?BC766282" target="BC766282" id="target_BC766282">open window</a>
     33 </body>
     34 </html>