tor-browser

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

file_sandbox_12.html (1601B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <script src="/tests/SimpleTest/EventUtils.js"></script>
      6 </head>
      7 <script type="text/javascript">
      8  function ok(result, desc) {
      9    window.parent.postMessage({ok: result, desc}, "*");
     10  }
     11 
     12  function doStuff() {
     13    ok(true, "documents sandboxed with allow-scripts should be able to run inline scripts");
     14 
     15    document.getElementById('a_form').submit();
     16 
     17    // trigger the javascript: url test
     18    sendMouseEvent({type:'click'}, 'a_link');
     19  }
     20 </script>
     21 <script src='file_sandbox_pass.js'></script>
     22 <body onLoad='ok(true, "documents sandboxed with allow-scripts should be able to run script from event listeners");doStuff();'>
     23  I am sandboxed but with "allow-same-origin" and allow-scripts"
     24 
     25 
     26  <!-- Content-Security-Policy: sandbox allow-same-origin allow-scripts; default-src 'self' 'unsafe-inline'; -->
     27 
     28  <!-- these should be stopped by CSP -->
     29  <img src="http://example.org/tests/dom/security/test/csp/file_CSP.sjs?testid=img12_bad&type=img/png"> </img>
     30  <script src='http://example.org/tests/dom/security/test/csp/file_CSP.sjs?testid=script12_bad&type=text/javascript'></script>
     31 
     32  <form method="get" action="/tests/content/html/content/test/file_iframe_sandbox_form_fail.html" id="a_form">
     33    First name: <input type="text" name="firstname">
     34    Last name: <input type="text" name="lastname">
     35    <input type="submit" onclick="doSubmit()" id="a_button">
     36  </form>
     37 
     38  <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>
     39 </body>
     40 </html>