Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amp-iframe resize not working #3046

Closed
antipath opened this issue Apr 29, 2016 · 5 comments
Closed

amp-iframe resize not working #3046

antipath opened this issue Apr 29, 2016 · 5 comments
Assignees
Milestone

Comments

@antipath
Copy link

Hi guys,

for the amp-iframe extended component if we leave out "allow-same-origin" value from the sandbox attribute, the amp-iframe does not resize.

What browsers are affected?

All browsers

Which AMP version is affected?

v. 1460655576651

@dvoytenko
Copy link
Contributor

@antipath Do you have a sample document?

/to @sriramkrish85 PTAL.

@antipath
Copy link
Author

antipath commented Apr 29, 2016

I have included the amp-iframe extended component js

and produced the following amp-iframe code

<amp-iframe sandbox="allow-scripts allow-top-navigation" layout="responsive" src="https://somedomain.com/amp/ampiframe.html" height="311" width="320" resizable="" class="poll-container -amp-element -amp-layout-responsive -amp-layout-size-defined -amp-layout" frameborder="0" id="AMP_16" scrolling="no" style="height: 311px;">

<i-amp-sizer style="display: block; padding-top: 0px;"></i-amp-sizer>
<div overflow="" tabindex="0" role="button" aria-label="Read more">Read more!</div>

<i-amp-scroll-container class="amp-active">
<iframe class="-amp-fill-content" width="320" height="309" name="amp_iframe0" frameborder="0" scrolling="no" sandbox="allow-scripts allow-top-navigation" src="https://somedomain.com/amp/ampiframe.html">
</iframe></i-amp-scroll-container>

</amp-iframe>

then on the iframe page itself i have the following that post messages back to the parent

window.parent.postMessage(JSON.stringify({ sentinel: 'amp', type: 'embed-size', height: document.body.scrollHeight }), '*');

Thanks for your help!
Vince

@camelburrito
Copy link
Contributor

@antipath i think your issue is similar to

#2940

Please go through our discussion on the bug and let me know if that helps.

@antipath
Copy link
Author

@sriramkrish85,

The issue resolves once I put in "allow-same-origin", I guess I should hosting my iframe on another subdomain and apply "allow-same-origin" to see if that works

@ericlindley-g ericlindley-g added this to the Backlog milestone May 2, 2016
@camelburrito
Copy link
Contributor

Closing this bug as this is a non issue

@ericlindley-g looks like we need to document this better or even remove the check for origin. Could you open a bug for this and we can discuss.

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

No branches or pull requests

4 participants