Tiny-slider: CSP header issue

Created on 16 Feb 2018  Â·  17Comments  Â·  Source: ganlanyuan/tiny-slider

Hey there,
great plugin, just one thing:
Currently I'm implementing CSP headers for more security, is there an easy way to access the <style> tag being injected at the end of the document? I want to get rid of all unsafe-inline tags, or at least need a way to add nonces / hashes to make them safe.

What's the best way to go about this?
Thx!

_Tiny-slider version_: current
_Browser name && version_: Firefox, Chrome

enhancement

Most helpful comment

Any update on this issue? The inline animation style is blocking my CSP form passing without tge 'unsafe-inline' rule.

All 17 comments

One could, however include the styles anyway, but .. since the inline-styles aren't loaded, the script won't work - instead, you'll receive this:

Uncaught TypeError: Cannot use 'in' operator to search for 'insertRule' in undefined:
var rule = 'insertRule' in sheet ? sheet.cssRules : sheet.rules;

I could give access to the sheet element, but yes, without the inline style, the slider won't work.
Please let me know what else I can do.
Thanks

Well, we'd need a way to pass a nonce to the