This document requires 'TrustedHTML' assignment. The action has been blocked. #6542
JonWallsten
started this conversation in
Stencil Testing
Replies: 1 comment 5 replies
-
|
Hey @JonWallsten - sorry for your woes. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I'm having an issue getting CSP to work with our company library that uses Stencil.
I think we're using 4.19.x and I saw that the latest is 4.41.x, but I can't find any tickets that this has been resolved.
On the other hand it would be wierd if I'm the only one with the issue.
https://github.com/stenciljs/core/blob/8f9efc5570983ff4d03580f4000ae5f844e7f641/src/runtime/styles.ts#L87C19-L87C36
I get the
This document requires 'TrustedHTML' assignment. The action has been blocked.error when I load my page.I seems like it's not allowed to add the styles. I have added both the meta tag for nonce fallback, and I'm also called the setNonce() method. I can see that the
plt.$nonce$has the correct value. But the nonce is added the innerHTML is assigned, and it's not allowed to assing it. I guess it's two different issues though. Loading the actual style when it's added to the DOM required the nonce to be set on the element itself. But there is something else missing to allow the browser to add the content to the tag.Is there a fix or workaround for this?
Beta Was this translation helpful? Give feedback.
All reactions