Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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>