child.html (378B)
1 <!doctype html> 2 <h2>Child Frame</h2> 3 <script> 4 onload = () => { 5 let count = 0; 6 const loop = () => { 7 if (++count < 10) { 8 requestIdleCallback(loop); 9 } else { 10 const target = location.href.replace('www1.', '') 11 .replace('resources/child.html', ''); 12 window.parent.postMessage('done', target); 13 } 14 }; 15 requestIdleCallback(loop); 16 } 17 </script>