file_iframe_sandbox_c_if2.html 871 B

123456789101112131415161718192021222324
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Test for Bug 341604</title>
  6. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  7. </head>
  8. <script type="text/javascript">
  9. function ok(result, desc) {
  10. window.parent.postMessage({ok: result, desc: desc}, "*");
  11. }
  12. function doStuff() {
  13. ok(false, "documents sandboxed without allow-scripts should NOT be able to run inline scripts");
  14. }
  15. </script>
  16. <script src='file_iframe_sandbox_fail.js'></script>
  17. <body onLoad='window.parent.postmessage({ok: false, desc: "documents sandboxed without allow-scripts should NOT be able to run script from event handlers"}, "*");doStuff();'>
  18. I am sandboxed with no permissions
  19. <img src="about:blank" onerror='ok(false, "documents sandboxed without allow-scripts should NOT be able to run script from event handlers");')>
  20. </body>
  21. </html>