Content Security Policy

How to fix the Content Security Policy error

A Content Security Policy (CSP) can greatly reduce the risk and impact of XSS and other code injection attacks in browsers. It defines an HTTP header that allows the creation of a whitelist of trusted content sources and instructs the browser to only execute or render resources from those sources.

So, if the following error appears in the console on your site -

- it means that instead of downloading the script from this source, the browser blocked it.

More information on this error can be found in this article.

An example of an error you may receive when using Dashly:

Refused to connect to 'wss://' because it violates the following Content Security Policy directive: "default-src https:". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback

It means that the wss protocol, which is required for the chat to work, is not allowed in the Content Security Policy settings.

If CSP is configured on your site, then you need to add the policy as follows in order for our services to work:

script-src https://* 'unsafe-inline' 'unsafe-eval';

style-src https://* 'unsafe-inline';

img-src https://*;

font-src https://*;

connect-src https://* https://* wss://*;

media-src https://*;

If you have a Calendly integration configured, then add this to your policy as well:




When the policy is updated, the error will disappear and everything will work correctly.

Powered by