Skip to content

Commit

Permalink
Fixing channel messaging type error
Browse files Browse the repository at this point in the history
  • Loading branch information
marrionluaka committed Sep 21, 2023
1 parent df1f3a0 commit 6d7d636
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 @@ -14,6 +14,8 @@
window.addEventListener("message", onMessage);

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

output.innerHTML = e.data;
// Use the transfered port to post a message back to the main frame
e.ports[0].postMessage("Message back from the IFrame");
Expand Down

0 comments on commit 6d7d636

Please sign in to comment.