Links and buttons do not work in AMP iframe component

428 Views Asked by At

I have an amp-iframe that I serve to a client, the links and buttons inside this amp-iframe have an unexepected behavior has they are not working at all. One is a button that runs a Javascript function, the other one is simply an <a href=""> anchor.

For the button I have this error :

Uncaught DOMException: Failed to set the 'href' property on 'Location': The current window does not have permission to navigate the target frame to my location

For the anchor I have :

Unsafe JavaScript attempt to initiate navigation for frame with origin origin from frame with URL amp-iframe origin. he frame attempting navigation is sandboxed, and is therefore disallowed from navigating its ancestors.

Here is a sample code of my amp-iframe integration :

<amp-iframe
width="200"
height="850"
sandbox="allow-scripts allow-same-origin allow-top-navigation"
layout="responsive"
frameborder="0"
src="https://api.mysite.fr/XXX.html"
>


<div placeholder>
     Error
</div>


</amp-iframe>

Any ideas that can resolve this ?

0

There are 0 best solutions below