This has come up before:
* https://ww.wp.xz.cn/support/topic/how-to-add-allow-presentation-attribute-to-amp-iframe/
* https://ww.wp.xz.cn/support/topic/google-console-error/#post-9946202
See https://github.com/ampproject/amp-wp/issues/938
However, what is responsible for the amp-iframe being generated is different.
Here is the generated code:
var imedia = "<amp-iframe src=%5C%22%22 media allowfullscreen frameborder=0 sandbox="allow-scripts allow-same-origin" height=400 layout=fixed-height><span placeholder class=amp-wp-iframe-placeholder></span><noscript><iframe></iframe></noscript></amp-iframe>";
The AMP plugin should be stripping out the script that contains that JS code, but instead the contents of the script are getting erroneously put into the page.
I’ve captured the output of the non-AMP and AMP versions of the page here:
https://gist.github.com/westonruter/387c1ba7e9fb6732e516ccb54d5220ab
What theme/plugin is responsible for this code being added to the page:
<script type=text/javascript>jQuery(document).ready(function($){function sb_getwinsize(){var wsize={winCurrentWidth
Hi Weston,
I decided to remove the lightbox function on the page which was probably responsible for the iframe. I then retested the amp page and it no longer seems to have this issue.
Thank you
P.s.
This is the plugin I’m using for the feed: https://axentmedia.com/ax-social-stream/
And the theme is newspaper 8: https://themeforest.net/item/newspaper/5489609
OK, thanks. And since you’re using Newspaper I suggest getting additional support from the tagDiv forum since the them modifies the behavior of the AMP plugin.
I am getting the same problem
The tag ‘iframe’ is missing a mandatory attribute – pick one of [‘src’, ‘srcdoc’]
Here is the tag:
<amp-iframe id=”gform_ajax_frame_4″ sandbox=”allow-scripts allow-same-origin” height=”400″ layout=”fixed-height” class=”amp-wp-db0bb1b”>
I understand that the code that is missing is this:
src=”https://cdn.ampproject.org/v0/amp-iframe-0.1.js”
What I need help with is adding the src code to the amp-iframe tag. How do I add it? I’m pretty new at this so please be gentle!