Description
Content security policies can specify a value for the nonce
that must be present on all inline styles, in the style-src
part of the directive. When a nonce is specified, the unsafe-inline
directive is ignored.
The idea is to prevent styles included in user-supplied content from being applied. The nonce should be different each time the page is loaded, so this only protects against content that doesn't change with each page load.
The Google closure library resolves this by finding a <script>
tag in the page with the nonce
attribute, and using that. There isn't always one of those, so it should be possible to pass it as an option in the MathJax config, too.
I'm looking at this today to get the MathJax integration on mastodon working, so I might have a pull request soon.