I am trying to set up a clickable image on my SharePoint site that navigates to another SharePoint page when clicked. I am using Embed Web Part and iframe. Here's what I have so far:
- HTML Structure
I am using an iframe to point to an HTML file stored in my SiteAssets folder. The HTML includes an image with a clickable image map:
<iframe src="xxx/embed.aspx?UniqueId=<guid>" width="640" height="360" frameborder="0" scrolling="no" allowfullscreen title="process9"></iframe>
HTML (in SiteAssets folder):
<img src="xxx/SiteAssets/Prozess1.png" usemap="#processmap" alt="Process Map">
<map name="processmap">
<area alt="kunde-tcc" title="kunde-tcc" href="../../SitePages/lorem-ipsum.aspx?env=Embedded" target="_self" coords="224,160,224,121,124,121,128,141,125,159" shape="poly">
<area alt="produktion-steuern" title="produktion-steuern" href="../../SitePages/lorem-ipsum.aspx?env=WebView" target="_self" coords="270,121,275,138,268,157,367,159,372,140,365,121,365,122" shape="poly">
</map>
- Problem
Clicking on the image map areas results in the following console error:
Blocked script execution in '' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
Blocked script execution in 'xxx/SitePages/lorem-ipsum.aspx?env=WebView' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
I have tried both ?env=Embedded and ?env=WebView in the URLs to show only the page content, but the error persists.
- Attempted Solutions
I attempted to set iframe permissions:
sandbox="allow-scripts allow-same-origin allow-forms allow-top-navigation"
But SharePoint blocks these permissions.
When I remove the sandbox attribute using the browser's developer tools, the navigation works as expected, but I can't do this in production.
- Question
Is there a workaround that allows me to navigate between SharePoint pages from the image map within the iframe, without triggering the sandbox restrictions? Or do I need to take a different approach?