About window.postMessage()

 window.postMessage()
method safely enables cross-origin communication. Normally, scripts on different pages are allowed to access each other if and only if the pages that executed them are at locations with the same protocol(https).
window.postMessage()
provides a controlled mechanism to circumvent this restriction in a way which is secure when properly used.


Demo

Messaging with Visualforce Page

References


  1. MDN
  2. Cross-Domain Messaging With postMessage
  3. Communicating between Lightning Components and Visualforce Pages

Account ID Account name
123 Account 1
456 Account 2
meaningful text
meaningful text

Accounts

My Accounts