Content Security Policy (CSP) support
Content Security Policy (CSP) support
Recommended setup
The Web Widget (Classic) supports websites that use a Content Security Policy (CSP) and follows Google'sstrict CSP guidelines. We recommend following Google's policy for the best support and easiest setup with the widget.
When following these guidelines, add thenonce
attribute to the Web Widget snippet.
<script
nonce="{random}"
id="ze-snippet"
src="https://static.zdassets.com/ekr/snippet.js?key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
>script>
This{random}
value must be a unique cryptographic number that is generated by the server each time the CSP is transmitted.
Note: This security policy works with the new version of the Zendesk Web Widget (Classic) snippet. Please ensure that your snippet looks like the example above.
Custom setup (using other CSP directives)
We cannot guarantee that the Web Widget (Classic) won't violate a custom CSP that does not follow Google'sguidelines. However, if you add the following directives, it should prevent the widget causing violations:
default-src'self'
https://static.zdassets.com
https://ekr.zdassets.com
https://ekr.亚博.com
https://{zendeskSubdomain}.亚博.com
https://*.zopim.com
https://zendesk-eu.my.sentry.io
wss://{zendeskSubdomain}.zendesk.com
wss://*.zopim.com;
style-src 'unsafe-inline';
img-src 'self'
https://v2assets.zopim.io
https://static.zdassets.com
data:;
If you have custom directives specified such asscript-src
或connect-src
, add the hosts specified indefault-src
above.