Skip to content
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

Make JS views rendered work with content security policy #32600

Merged
merged 1 commit into from
Apr 20, 2018

Conversation

y-yagi
Copy link
Member

@y-yagi y-yagi commented Apr 17, 2018

As of now, HTMLElement.nonce seems to work only in Chrome. So, it should not be used now.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/nonce#Browser_compatibility

Fixes #32577.

@y-yagi
Copy link
Member Author

y-yagi commented Apr 17, 2018

cc @pixeltrix

@pixeltrix
Copy link
Contributor

I thought I tested this in Safari too - I'll dig a bit deeper

@pixeltrix
Copy link
Contributor

@y-yagi have you tried this change in Firefox? I'm not sure whether using setAttribute will fix it if it doesn't support executing scripts with a nonce attribute.

@pixeltrix
Copy link
Contributor

Okay, running the UJS tests locally in Firefox shows it fixes the problem. There are some other UJS failures in Firefox but I think they're unrelated to this.

@y-yagi if you can add a CHANGELOG this is good to merge 👍

@y-yagi y-yagi merged commit 1694b02 into rails:master Apr 20, 2018
@y-yagi y-yagi deleted the fix_32577 branch April 20, 2018 06:42
@y-yagi
Copy link
Member Author

y-yagi commented Apr 20, 2018

Thank you for your review! I merged and backported 744a506.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants