As is, the JS used for opening the PDF file preview is an inline script.
This will break if the admin sets a stricter CSP header for script-src (by disallowing the unsafe-inline source).
Moving said script into a separate file allows a stricter CSP configuration, such as we are currently running:
{%- block tuw_metadata -%}
{#- this is where the schema.org metadata (as fetched from datacite) is inserted, for google datasets #}
{%- set schemaorg_metadata = tuw_create_schemaorg_metadata(record) %}
{%- if schemaorg_metadata %}
<script type="application/ld+json" nonce="{{ csp_nonce() }}">
{{ schemaorg_metadata|safe }}
</script>
{%- endif %}
{%- endblock tuw_metadata %}
As is, the JS used for opening the PDF file preview is an inline script. This will break if the admin sets a stricter CSP header for
script-src
(by disallowing theunsafe-inline
source). Moving said script into a separate file allows a stricter CSP configuration, such as we are currently running:Side note: The
nonce
value is used in our customized landing page for the schema.org JSON-LD metadata: