tor-browser

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

file_iframe_sandbox_c_if1.html (1270B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Test for Bug 341604</title>
      6  <script src="/tests/SimpleTest/EventUtils.js"></script>
      7  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
      8 </head>
      9 <script type="text/javascript">
     10  function ok(result, desc) {
     11    window.parent.postMessage({ok: result, desc}, "*");
     12  }
     13 
     14  function doStuff() {
     15    ok(true, "documents sandboxed with allow-scripts should be able to run inline scripts");
     16 
     17    document.getElementById('a_form').submit();
     18 
     19    // trigger the javascript: url test
     20    sendMouseEvent({type:'click'}, 'a_link');
     21  }
     22 </script>
     23 <script src='file_iframe_sandbox_pass.js'></script>
     24 <body onLoad='ok(true, "documents sandboxed with allow-scripts should be able to run script from event listeners");doStuff();'>
     25  I am sandboxed but with "allow-scripts"
     26 
     27  <form method="get" action="file_iframe_sandbox_form_fail.html" id="a_form">
     28    First name: <input type="text" name="firstname">
     29    Last name: <input type="text" name="lastname">
     30    <input type="submit" onclick="doSubmit()" id="a_button">
     31  </form>
     32 
     33  <a href = 'javascript:ok(true, "documents sandboxed with allow-scripts should be able to run script from javascript: URLs");' id='a_link'>click me</a>
     34 </body>
     35 </html>