Problem
In recent Chrome browser, it has become little annoying to work with SharePoint tool due to Chrome throwing ERR_BLOCKED_BY_XSS_AUDITOR error when working with the Script Editor web part. This is due to XSS auditor on Chrome blocking JavaScript included in the Script Editor Web Part. Issue occurs on SharePoint Online and on-premises SharePoint 2016 and 2013 and occurs regardless if site is accessed via HTTP or HTTPS.Steps to repro:
- On SharePoint publishing page, add Script Editor web part to content area or web part zone
- Add the following code to the web part (any JS will do the trick):
<script>
console.log("asd")
</script>
- Click Insert at the bottom of the Script Editor content dialog
--> Chrome throws you to page saying
This page isn’t working
- Try visiting the site's homepage.
Workaround
You can disable the XSS Auditor by appending the following value to web.config on your on-premises SharePoint 2013 or 2016 web site.<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-XSS-Protection" value="0" />
</customHeaders>
For SharePoint Online, there is no workaround at the moment.