I am using visualforce page inside a lightning component as an iframe. For communication, i use parent.postmessage(message, origin);
. Problem is, that at the moment i have hardcoded URL's, but when i deploy to production the domain names will be different.
In lightning experience, i need visualforce URL to confirm, that the message is coming from an expected origin.
How can i get lightning experience domain from visualforce and how can i get visualforce domain name from lightning experience?