Forum Discussion
Issue related to "Blocked script execution in <URL>" in Embed Webpart | SharePoint Online
Hi,
I have created one HTML file which having code related to Image Map element. After uploading html file to site assets library using embed code of it in the "Embed" webpart giving an error while clicking on any which has been mapped in Image Map as" Blocked script execution in <URL>. Blocked opening <URL> in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set".
Any solution to over come this problem in SharePoint Online Embed Webpart.
Regarards,
Pratik
2 Replies
- George09Copper Contributor
Hey Pratik, this happens because the SharePoint Online Embed webpart runs in a sandboxed iframe that restricts things like JavaScript execution and pop-ups by design. Unfortunately, you can’t enable allow-popups in that iframe manually.
A workaround would be to use a Script Editor webpart (available via classic pages or third-party SPFx solutions) or build a custom SPFx webpart to embed your HTML with full control. That way, your image map links and scripts should work without those sandbox restrictions.
Hope this helps!
- grant_jenkinsIron Contributor
I don't think this will be possible, especially now that Microsoft have disabled scripts on pages (for good reason). Even if you enabled scripts for a page, there is a daily job behind the scenes that will disable it again.
I'd suggest looking at utilizing Power Apps to get what you're after (clickable image map). I personally don't like image maps as they are generally not responsive at all, so viewing your page on a mobile device may render it unusable.