This respository provides you with the example code to enable cross-domain communication between a parent window and child iframe.
You can view a working copy of cross-domain communication at https://crosscomm.app. The code to the iframe is located at https://github.com/crookse/cross-comm-iframe. https://crosscommiframe.app implements that code.
To learn more about how to use the code and how to enable cross-domain communication (for this specific case), view the Medium article here.