I'm trying to get a value from local storage on a site loaded through an Iframe. I'm able to send a message to the site within the iframe through postMessage, but haven't figured out how to return data from the postMessage call. I've looked into promises, but haven't figured out how to get it working.
Anyone have an idea?
I iframe window needs to listen for the "message" event, process the message, and then send a postMessage back to the window of the messenger.
You can read about the API here: window.postMessage().
David Walsh has also written a good tutorial on how to do this.
I hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With