-
Notifications
You must be signed in to change notification settings - Fork 787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSP header issue #158
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:
|
I could give access to the |
Well, we'd need a way to pass a nonce to the <style> tag, which is basically just a string, eg: <style nonce="SOME-STRING">
<!-- tns rules -->
</style> Passing a hash isn't an option imho, since we don't control the styles, and they may change. |
|
Hey @ganlanyuan and @S1SYPHOS, |
var slider = tns(…),
sheet = slider.getInfo().sheet;
sheet.nonce = 'string'; |
@ganlanyuan: |
Can you get the |
Yeah:
|
I actually can't test whether it works for CSP headers or not. |
Any way to check wether this gets applied or not with Chrome's dev-tools? I know it's complicated, being injected and all .. |
Any update on this issue? The inline animation style is blocking my CSP form passing without tge 'unsafe-inline' rule. |
I ran into the same problem today. The problem is within the method
In this function, the
It think it would be sufficient if there were an additional configuration option like |
This option adds a nonce attribute to the inline style tag created by tiny-slider. It allows the usage of tiny-slider with a more strict Content Security Policy. Its not necessary anymore to allow unsafe-inline. Resolves: ganlanyuan#158
I added the option mentioned by @codegain. Is the media parameter of the |
Thank you all! |
@ganlanyuan Is a new release planned with this feature included? |
Sorry to bring this up again, but .. .. 'm getting the nonce from |
Hello, do you have any idea how to integrate the generated nonce in my server request at the file tiny-slider.js ? Usually I get it while asking req.nonce, I tested with XMLHttpRequest(), but it doesn't work. server.js :
|
I ran into an similar issue and searched the code for inline styles. It seems like there are still inline styles with the navigtion option. |
Yeaaaaaa |
Can we please update this issue, i have moved from owl.carousel with this library, for the most part owl doesn`t have this issue and it is a library 5 years old. We surely can make a css style sheet so it will be included the class instead of the dynamic inline style PLEASE fix this issue it would be a shame to go back to owl.carousel. Putting a nonce inside there is not a fix it is a workaround |
I know this is old, but in case someone ends up here that doesn't know about it: When calling
|
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 allunsafe-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
The text was updated successfully, but these errors were encountered: