We are enforcing Content Security Policy in Content Studio, which means that inline Javascript will stop working in widgets after the upcoming 4.1.0 release. This script has to be replaced.
Suggested fix:
Implement a service that returns required config object (example)
Pass url of the service as a data attribute to the client-side JS asset (example)
Inside the JS asset, get config service url from the data attribute and fetch config from the service (example). In this last example we use lib-admin-ui to fetch the config, but you can use simple fetch API.
Hi Glenn,
We are enforcing Content Security Policy in Content Studio, which means that inline Javascript will stop working in widgets after the upcoming 4.1.0 release. This script has to be replaced.
Suggested fix:
Implement a service that returns required config object (example)
Pass url of the service as a data attribute to the client-side JS asset (example)
Inside the JS asset, get config service url from the data attribute and fetch config from the service (example). In this last example we use lib-admin-ui to fetch the config, but you can use simple fetch API.