Allow amp-iframe in amp-story-page-attachment
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.
@newmuis for feedback on this approach for amp-story. added categories as appropriate.
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 any updates on this?
This is something that we're going to experiment with over the coming weeks. It's clear that there are a few tradeoffs:
- The cookies comment made above (although, this is no different than any other iframe)
- 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 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).
@newmuis Any updates on this?
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 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
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.