A better way to configure CSP and disable unsafe-inline
Author: elcousCreated Nov 9, 2025Updated Nov 9, 2025
I found a better way to configure CSP that does not require unsafe-inline overwrite
- In initializer add a CSS class instead of inline style:
html: '<div id="%<id>s" class="dashboard-chart">%<loading>s</div>'- add your css class (height, alignment font etc)
Works if you can have same style across all charts.
Source: ankane/chartkick