DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
csp:script¶
With the script ViewHelper you can add javascript code blocks to your fluid template. In the background the script will be trimmed and compressed and a hash or nonce value will be registered in the content security policy header.
Attention
The extension favours hash over nonce because it checks the content of the script also.
Properties¶
hashMethod¶
- Variable type
- String
- Description
- This option decides which hash algorithm to use. Possible values: sha256, sha384, sha512. This is ignored if the script method is set to "nonce". See by the "Extension settings".
- Default value
- sha256
- Mandatory
- No
Examples¶
<csp:script>alert("It works.");</csp:script>