iframe-trying-to-navigate-itself.html (442B)
1 <!DOCTYPE html> 2 <p>If this message appears, then this frame has not been navigated.</p> 3 <script> 4 window.onload = function() { 5 try { 6 location.href = "data:text/html,\u003c!DOCTYPE html\u003e\u003cp\u003eIf this message appears, then this frame has been navigated.\u003c/p\u003e\u003cscript\u003eparent.postMessage('can navigate', '*');\u003c/script\u003e"; 7 } catch(e) { 8 parent.postMessage("can not navigate", "*"); 9 } 10 } 11 </script>