Link from AMP parent frame to page in iframe

I am building a static website using accelerated mobile pages (AMP). Many pages contain iframes using the "amp-iframe" tag. Children's pages are not compatible with AMP.

I need the child page to determine when the parent page has finished loading. Normal parent.window.onloadcannot be used here because parent pages will often be in different domains (mainly Google caches) than on child pages.

AMP implements some part of the method postMessageas a way of communicating between frames ( https://www.ampproject.org/docs/reference/components/amp-iframe ), but it is bad and I cannot understand how to reliably transmit messages outside of one example. shown on this page.

Any help would be greatly appreciated.

+4
source share

Source: https://habr.com/ru/post/1666558/


All Articles