Blocked script execution in 'about:srcdoc' because the document's frame is sandboxed and the 'allow-scripts' permission is not set

Babak Salimi 1 Reputation point

I have created a HTML page that would be used within the organization only and never access any websites. It is used to recreate MS forms data through power automates which works fine and is not the issue.

I need to be able to run a javascript that would allow users to update the populated html page with new info, the script works fine while testing it on a local pc but gives the mentioned error when it is uploaded to sharepoint online, at which point the script stops working.

the script is not inline and separate from the html code, the allow script has been activated at tenant level, i have also clicked on allow all iframes and the issue persists.

any help would be appreciated at this point since i am at a road block

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,825 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jerryzy 10,566 Reputation points

    Hi @Babak Salimi ,

    If you are using <iframe> tag to reference a html file in SharePoint Online page, try to set sandbox property to "allow-same-origin allow-scripts allow-popups allow-forms" like this:



    Or in SharePoint Online classic experiece, you could also use Script Editor Web Part to inject custom html and JavaScript into the page directly:

    Script Editor Web Part in SharePoint 2016/2013/Online

    Best Regards

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments