doc-message-run-to-completion.html (644B)
1 <iframe id="iframe" src="doc-message-run-to-completion-frame.html"></iframe> 2 <script> 3 function test() { 4 var messageName = "test-message"; 5 6 function handleMessage(event) { 7 // While paused here, the additional posted messages should not be delivered. 8 // The debugger should pause three times. 9 debugger; 10 } 11 12 window.addEventListener("message", handleMessage, true); 13 document.getElementById("iframe").contentWindow.addEventListener("message", handleMessage, true); 14 15 window.postMessage("first", "*"); 16 document.getElementById("iframe").contentWindow.postMessage("second", "*"); 17 window.postMessage("third", "*"); 18 } 19 </script>