moveBefore-iframe.html (568B)
1 <!-- This document is used to report back to its parent (1) a message indicating 2 initial load, and (2) a message ACKing the result of moveBefore() being 3 called in the parent. It helps the parent test that this subframe was not 4 reloaded after moveBefore() is called on it --> 5 <!DOCTYPE html> 6 <body> 7 <script> 8 window.onload = e => { 9 10 window.onmessage = e => { 11 if (e.data === 'after moveBefore') { 12 window.parent.postMessage('ack after moveBefore', '*'); 13 } 14 } 15 16 window.parent.postMessage('loaded', '*'); 17 } 18 </script> 19 </body>