I2I: Implement amp-inabox, an AMP page living inside a non-scroll-able x-origin iframe #5700

Closed
lannka opened this Issue Oct 19, 2016 · 0 comments

Comments

Projects
None yet
3 participants
@lannka
Collaborator

lannka commented Oct 19, 2016

amp-inabox is an AMP page living inside a x-origin iframe with scrolling disabled. So the whole iframe scrolls with the host document. The major use case is to display A4A in such an iframe in a non-AMP document.

The AMP runtime inside the iframe needs to communicate to the host doc, so that it can

  • get viewport position which is essential for visibility tracking, resource scheduling and video autoplay etc.
  • get host document info which is needed for amp-analytics to work
  • ask for iframe resizing

A messaging channel needs to be established between the host doc and AMP in the iframe. So we propose a pair of scripts named amp-inabox.js and amp-inabox-host.js to be installed at each end.

More precisely, amp-inabox.js is compiled as a different runtime entrypoint, and served at https://cdn.ampproject.org/amp4ads-v0.js. It is to replace the v0.js runtime script in an A4A creative. amp-host-v0.js is a standalone script that will be loaded on the host doc.

Planned work:

  • introduce new entry point for AMP runtime, and served as amp4ads-v0.js (delivered)
  • sample bootstrap code for host page to load amp-inabox-host.js (delivered)
  • update spec & validator
  • viewport API

Future work:

  • docinfo API
  • resize API

@lannka lannka self-assigned this Oct 19, 2016

@ericlindley-g ericlindley-g added this to the Current milestone Nov 3, 2016

@lannka lannka changed the title from [amp-inabox] Implement amp-inabox and amp-inabox-host to I2I: Implement amp-inabox, an AMP page living inside a non-scroll-able x-origin iframe Nov 11, 2016

@jasti jasti closed this Feb 9, 2017

@lannka lannka moved this from Current - Core AMP to Done in AMP Advertising Feb 11, 2017

@lannka lannka removed this from Done in AMP Advertising Feb 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment