CSP Troubleshooting - (Versions 24.2 and 24.3)

Modified on Fri, 29 Nov at 12:29 PM

(Versions 24.2 and 24.3)


Editor

There may be an issue with running the Overlay inside the Newired Editor due to the internal web server using a random port (49152 to 65535). This can result in resources being blocked by the application server because of Content Security Policy (CSP) settings. The solution is to add the localhost domain to the trusted pages of the application.


Set Up Trusted Pages

1.Add the localhost domain to the trusted pages of your application to facilitate resource loading without obstruction.


Configure Internal Port (if necessary)

If your application does not allow specifying a range of trusted ports, you will need to configure the Editor to use a predefined port. This requires updating the userData.json file to include the internalHttpServerPort property.

How to Update userData.json

1. Locate the  userData.json file:

   - Path: C:\Users\<Your_Username>\AppData\Roaming\Newired Editor\userData.json

2. Edit the file:

   - Open the userData.json file in a text editor.

   - Add the internalHttpServerPort property at the end of the JSON configuration. It should resemble the following structure: 


{
       "trustedDomains": [
         "https://try.stage.newired.com",
         "http://172.31.252.120:8090/newired"
       ],
       "siteHistory": [
         {
           "siteId": 605,
           "lastVisitedUrl": "....."
         },
         {
           "siteId": 1403,
           "lastVisitedUrl": "......"
         }
       ],
       "internalHttpServerPort": 65000
     }


Reopen Newired Editor.

If the Overlay is still not functioning and you notice that resources like `api.bundle.js` and `html-css-sanitizer-minified.js` are being blocked, you may need to disable the following features:


Disable Newired API (Server Level)

In case you have the Newired installation on your local server, you can adjust this in the Newired.properties file Path: /tomcat/conf/newired.properties

If the property is not existing in file, please add linenewired.frontendHtmlSanitize=false   


newired.frontendHtmlSanitize=false


Disable Sanitization (Server Level)

In case you have the Newired installation on your local server, you can adjust this in the Newired.properties file Path: /tomcat/conf/newired.properties

If the property is not existing in file, please add line overlayApi.enabled=false 


overlayApi.enabled=false


After completing these steps, restart the necessary services to apply the changes. This should help in resolving issues with running the Overlay in the Newired Editor. If problems persist, please reach out for further assistance.

  

   



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article