content/base/test/csp/file_bug886164_6.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <meta charset="utf-8">
     5   <script type="text/javascript" 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: desc}, "*");
    10   }
    12   function doStuff() {
    13     ok(true, "documents sandboxed with allow-scripts should be able to run inline scripts");
    15     document.getElementById('a_form').submit();
    17     // trigger the javascript: url test
    18     sendMouseEvent({type:'click'}, 'a_link');
    19   }
    20 </script>
    21 <script src='file_iframe_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-scripts"
    24   <img src="http://example.org/tests/content/base/test/csp/file_CSP.sjs?testid=img6_bad&type=img/png"> </img>
    25   <script src='http://example.org/tests/content/base/test/csp/file_CSP.sjs?testid=script6_bad&type=text/javascript'></script>
    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>
    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>

mercurial