I am using Postmessage described in this post https://developer.salesforce.com/blogs/developer-relations/2017/01/lightning-visualforce-communication.html
to communicate between vf page and lighting component it was working fine after 19 updates it is showing access denied error on load
component.xml
<aura:attribute name="vfHost" type="String" default="sonicsyed--c.ca15.visual.force.com'}"/>
<!-- The Visualforce page to send data to -->
<iframe aura:id="vfFrame" width='100%' height="{!v.iframeHeight +'px;'}" src="{!'https://' + v.vfHost + '/apex/VF_RichText'}" onload="{!c.onload}" style="border:0px" />
component.js
let vfOrigin = "https://" + component.get("v.vfHost");
let vfWindowComp = component.find("vfFrame");
if(vfWindowComp){
let vfWindow=vfWindowComp.getElement().contentWindow;
vfWindow.postMessage('hi', vfOrigin);
}
VF_RichText.vfp
var lexOrigin = "https://sonicsyed.lightning.force.com";
window.addEventListener("message", function(event) {
//console.log(event.origin);
//console.log(event.data);
if (event.origin !== lexOrigin) {
// Not the expected origin: reject message!
return;
}
// Handle message
if(!event.data){
return;
}
let cotainerData=event.data;
});