question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

  • Check if updating to the latest Preact version resolves the issue

Describe the bug Not sure if you have support for CSP:s trusted types, but I get an error when I try to add trusted types. And there seems to be no docs on trusted types.

Failed to set the 'innerHTML' property on 'Element': This document requires 'TrustedHTML' assignment.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/loving-haibt-79bkcf

Expected behavior What should have happened when following the steps above?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tinganhocommented, Mar 18, 2022

Nevermind, I missed to pass the correct trust policy in dangerousleSetInnerHtml. It’s working as expected now.

0reactions
tinganhocommented, Mar 18, 2022

Yes, I can try to create a reproducible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSP: trusted-types - HTTP - MDN Web Docs
The HTTP Content-Security-Policy (CSP) trusted-types Experimental directive instructs user agents to restrict the creation of Trusted Types policies ...
Read more >
Prevent DOM-based cross-site scripting vulnerabilities with ...
Trusted Types give you the tools to write, security review, and maintain applications free of DOM XSS vulnerabilities by making the dangerous ...
Read more >
Trusted Types - W3C on GitHub
Trusted Types can only be created via user-defined and immutable policies that define rules for converting a string into a given Trusted Type...
Read more >
Trusted Types - W3C
Trusted Types can only be created via user-defined and immutable policies that define rules for converting a string into a given Trusted Type...
Read more >
w3c/trusted-types: A browser API to prevent DOM ... - GitHub
Trusted Types. First time here? This is a repository hosting the Trusted Types specification draft and the polyfill code. You might want to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found