AddToAny With A CSP
Use a nonce (required)
-
Generate a nonce per request, for example:
MzExMTMwNzgwMSwyNDY2MzU5MzQx
-
Include the nonce in your CSP:
Content-Security-Policy: script-src 'nonce-MzExMTMwNzgwMSwyNDY2MzU5MzQx'
-
Add the nonce attribute to your AddToAny <script> tag like so:
<script defer nonce="MzExMTMwNzgwMSwyNDY2MzU5MzQx" src="https://static.addtoany.com/menu/page.js"></script>
Use a nonce + 'strict-dynamic' (optional strict CSP)
-
Generate a nonce per request, for example:
MzExMTMwNzgwMSwyNDY2MzU5MzQx
-
Include the nonce in your strict CSP:
Content-Security-Policy: script-src 'nonce-MzExMTMwNzgwMSwyNDY2MzU5MzQx' 'strict-dynamic'
-
Add the nonce attribute to your AddToAny <script> tag like so:
<script defer nonce="MzExMTMwNzgwMSwyNDY2MzU5MzQx" src="https://static.addtoany.com/menu/page.js"></script>
Use a nonce + 'strict-dynamic' + Trusted Types (optional strictest CSP)
-
Generate a nonce per request, for example:
MzExMTMwNzgwMSwyNDY2MzU5MzQx
-
Include the nonce in your strict CSP requiring Trusted Types:
Content-Security-Policy: script-src 'nonce-MzExMTMwNzgwMSwyNDY2MzU5MzQx' 'strict-dynamic' require-trusted-types-for 'script'
-
Add the
addtoany policy name if you are using the trusted-types directive:
Content-Security-Policy: script-src 'nonce-MzExMTMwNzgwMSwyNDY2MzU5MzQx' 'strict-dynamic' require-trusted-types-for 'script'; trusted-types addtoany
-
Add the nonce attribute to your AddToAny <script> tag like so:
<script defer nonce="MzExMTMwNzgwMSwyNDY2MzU5MzQx" src="https://static.addtoany.com/menu/page.js"></script>