window.postMessage
30 April 2026 (Updated 30 April 2026)
What is window.postMessage?
By default, the same-origin policy only allows communication between different pages if they belong to the same origin. The window.postMessage method allows you to safely communicate messages between different Window objects from different origins. For example, you might want to transfer a message between a page and a iframe that it embeds.
Tagged:
Web APIs