I am building a static website using Accelerated Mobile Pages (AMP). Many pages contain iframes using the "amp-iframe" tag. The child pages are not AMP-compliant.
I need a way for a child page to determine when the parent page has finished loading. The normal parent.window.onload
can't be used here because the parent pages will often be in different domains (mostly Google's caches) than the child pages.
AMP implements some portion of the postMessage
method as a way to communicate between frames (https://www.ampproject.org/docs/reference/components/amp-iframe), but it is poorly documented and I can't figure out how to reliably pass messages beyond the one example shown at that page.
Any help would be greatly appreciated.