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

Remove assignment to innerHTML #340

Merged
merged 1 commit into from
Nov 8, 2021
Merged

Conversation

plamoni
Copy link
Contributor

@plamoni plamoni commented Nov 8, 2021

Replaces the assignment of '' to innerHTML with an assignment of '' to textContent in order to resolve the CSP issue described in #339.

The goal of this line of code is just to remove the content of the style node that is referenced by the carouselCssNode property. So there's no real difference between using textContent and innerHTML. Both have the same effect. However, since innerHTML potentially allows unsafe DOM injections, it should be avoided (such as in cases like this) when it's not needed.

Resolves #339

Replaces the assignment of `''` to `innerHTML` with an assignment of `''` to `textContent` in order to resolve the CSP issue described in uiuniversal#339.

The goal of this line of code is just to remove the content of the `style` node that is referenced by the `carouselCssNode` property. So there's no real difference between using `textContent` and `innerHTML`. Both have the same effect. However, since `innerHTML` potentially allows unsafe DOM injections, it should be avoided (such as in cases like this) when it's not needed.

Resolves uiuniversal#339
Copy link
Member

@santoshyadavdev santoshyadavdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @plamoni

@santoshyadavdev santoshyadavdev merged commit 683bee7 into uiuniversal:master Nov 8, 2021
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.

Usage of innerHTML assignment triggers CSP violation when Trusted Types are enforced
2 participants