Hello @kartik,
Using Window.postMessage()
This method safely enables cross-origin communication.
And if you have access to parent page code then any parent method can be called as well as any data can be passed directly from Iframe.
Hope it helps!!
Thank you!!