file_iframe_sandbox_d_if13.html (990B)
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 window.addEventListener("message", receiveMessage); 11 12 function receiveMessage(event) { 13 // this message is part of if_11's test 14 if (event.data.test == 'if_11') { 15 doIf11TestPart2(); 16 } 17 } 18 19 function ok_wrapper(result, msg) { 20 window.opener.postMessage({ok: result, desc: msg}, "*"); 21 window.close(); 22 } 23 24 function doIf11TestPart2() { 25 var if_11 = document.getElementById('if_11'); 26 if_11.sandbox = 'allow-scripts allow-same-origin'; 27 // window.history is no longer cross-origin accessible in gecko. 28 SpecialPowers.wrap(if_11).contentWindow.history.back(); 29 } 30 </script> 31 <body> 32 <iframe sandbox='allow-scripts' id="if_11" src="file_iframe_sandbox_d_if11.html" height="10" width="10"></iframe> 33 </body> 34 </html>