-
Notifications
You must be signed in to change notification settings - Fork 482
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
Don't trigger Content-Security-Policy errors due to injecting styles #465
Comments
@taion Yes, I agree. Thanks for raising! |
Okay, it turns out there's no actual exception here to catch. What do you think of adding some sort of function to disable the "style injection" behavior? |
@taion What do you think of removing this code? I think that it's time 🚀 react-swipeable-views/packages/react-swipeable-views/src/SwipeableViews.js Lines 25 to 26 in 248fec1
|
I'd be all for it. It's not quite 2019 yet, though. |
Plans are made to be changed :). |
Expected Behavior
Pages using react-swipeable-views with locked-down
style-src
should not show Content-Security-Policy errors from using react-swipeable-views.Current Behavior
injectStyle
tries to inject inline styling for old browsers. IE10 at least doesn't even supportstyle-src
, and it's likely the sufficiently old versions of Safari don't do so either.Steps to Reproduce (for bugs)
This shows up immediately when disabling inline CSS with Content-Security-Policy,
Context
This is just a slight annoyance when using locked-down CSP for styling and using this library. I think the easiest fix (per the title) is to just try-catch the style injection.
Your Environment
The text was updated successfully, but these errors were encountered: