-
Notifications
You must be signed in to change notification settings - Fork 284
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
Use dynamic event handlers on elements to prevent nonce-based CSP errors (unsafe-inline disallowed) #675
Use dynamic event handlers on elements to prevent nonce-based CSP errors (unsafe-inline disallowed) #675
Conversation
Thanks for the PR, can you post some basic jsfiddle / etc` with your PR to see how it behaves? I will try to go over it in the upcoming days |
Thanks @vedmack ! Here's an example - there is a console error but the example is functional. I can't quite track down in the call stack where the console error originates from... if you have any ideas/hints from anything that might be obvious to you that isn't to me, I'd be very happy to take another look at it :) |
@vedmack we've been using this in our production code with strict CSP and all seems to be working nicely :) |
on it now |
…n elements to prevent nonce-based CSP errors (unsafe-inline disallowed) - #675
@stringfellow , although it was years ago, I remember when that when I tried to use |
Hmmm indeed that is a bit strange! Thanks for merging, I missed the notification somehow so will take a look at reverting to the official release ASAP. Thanks again! |
This is a fix for issue #373 which causes significant issues for sites requiring strict CSP settings, allowing use of a
nonce
in the calling script tag, which which means the attached event handlers become trusted.I have made a start as a proof of concept and on the fields/use cases that address our needs at DemandLogic. If @vedmack approves this approach, it could be refactored to match throughout.
UPDATE: JSFiddle