file_iframe_sandbox_d_if11.html (843B)
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 <script src="/tests/SimpleTest/EventUtils.js"></script> 8 </head> 9 <script type="application/javascript"> 10 11 function navigateAway() { 12 document.getElementById("anchor").click(); 13 } 14 15 function doTest() { 16 try { 17 // this should fail the first time, but work the second 18 window.parent.ok_wrapper(true, "a document that was loaded, navigated to another document, had 'allow-same-origin' added and then was" + 19 " navigated back should be same-origin with its parent"); 20 } catch (e) { 21 navigateAway(); 22 } 23 } 24 25 </script> 26 <body onload='doTest()'> 27 I am sandboxed with 'allow-scripts' 28 <a href='file_iframe_sandbox_d_if12.html' id='anchor'>CLICK ME</a> 29 </body> 30 </html>