Skip to content

Commit

Permalink
Fixing channel messaging type error (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
marrionluaka authored May 22, 2024
1 parent 36eba9f commit 98c8bb8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions channel-messaging-basic/page2.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
window.addEventListener("message", onMessage);

function onMessage(e) {
if (!e.ports.length) return;

output.innerText = e.data;
// Use the transferred port to post a message to the main frame
e.ports[0].postMessage("A message from the iframe in page2.html");
Expand Down

0 comments on commit 98c8bb8

Please sign in to comment.