tor-browser

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

test_subframe_run_js_if_allowed.html (844B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=702439
      5 
      6 This test verifies that child iframes of CSP documents are
      7 permitted to execute javascript: URLs assuming the policy
      8 allows this.
      9 -->
     10 <head>
     11  <title>Test for Bug 702439</title>
     12  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     13  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     14 </head>
     15 <body>
     16 <iframe id="i"></iframe>
     17 <script class="testbody" type="text/javascript">
     18 var javascript_link_ran = false;
     19 
     20 // check that the script in the child frame's javascript: URL ran
     21 function checkResult()
     22 {
     23  is(javascript_link_ran, true,
     24     "javascript URL didn't execute");
     25 
     26  SimpleTest.finish();
     27 }
     28 
     29 SimpleTest.waitForExplicitFinish();
     30 document.getElementById('i').src = 'file_subframe_run_js_if_allowed.html';
     31 </script>
     32 </body>
     33 </html>