amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Allow amp-iframe in amp-story-page-attachment

Open Pateriack opened this issue 7 years ago • 9 comments

Describe the new feature or change to an existing feature you'd like to see

amp-iframe appears to function as expected within an amp-story-page-attachment, but it doesn't pass validation.

An example use case would be to embed google maps in an attachment.

validator-amp-story.protoascii#L708 mentions whitelisting as many components as possible, unless it results in bad UX or security issues. Do amp-iframes fall under either of those categories?

Describe alternatives you've considered

For the map use case, you could probably generate map images and use amp-img but the experience is not the same as supporting a full blown map embed.

Pateriack avatar Apr 05 '19 18:04 Pateriack

@newmuis for feedback on this approach for amp-story. added categories as appropriate.

honeybadgerdontcare avatar Apr 05 '19 19:04 honeybadgerdontcare

The question here is whether we can do this without breaking cookies in the embedded document, but I think that needs further investigation.

But, it's pretty clear that it's the best UX, if we're able to achieve it technically.

newmuis avatar May 14 '19 00:05 newmuis

@newmuis any updates on this?

Gregable avatar Jun 25 '19 18:06 Gregable

This is something that we're going to experiment with over the coming weeks. It's clear that there are a few tradeoffs:

  1. The cookies comment made above (although, this is no different than any other iframe)
  2. The UX of swiping down to close gets broken, since we can't get the touch events from the iframed content. Users will have to either explicitly drag from the header, or tap on an X to close the attachment.

newmuis avatar Jun 25 '19 20:06 newmuis

@newmuis In regards to your second point, does that imply that what you're exploring is to allow an iframe to take up the entire attachment?

What I'm looking for is the ability to embed a map at the top of the attachment content, with other content following underneath (which would be swipe-able).

Pateriack avatar Jul 10 '19 20:07 Pateriack

@newmuis Any updates on this?

Pateriack avatar Aug 13 '19 20:08 Pateriack

We're in the midst of a reviewing this from a security perspective and working through some changes to the engineering design as a result of that. We are probably targeting end of Q3 for this to hit production.

Sorry I missed your previous comment; our plans did not include the ability to mix iframes with inline content. We'll almost certainly launch the iframe-only case first, but can also think about contexts where it makes sense to allow mixed content as well (the case you mention sounds reasonable). Of note, the security considerations we're looking at would apply to any case where iframed content is allowed.

newmuis avatar Aug 13 '19 20:08 newmuis

@newmuis is there any resolution of this issue. Even I used the amp-iframe inside amp-story-grid-layer and got this validation issue The tag 'amp-iframe' may not appear as a descendant of tag 'amp-story-grid-layer'. In case if you explain the reason why it is so, will be helpful and is there any other workaround to fix this

patialmanoj avatar Dec 02 '21 12:12 patialmanoj

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 24 '22 03:12 stale[bot]