Site breaks in Chrome/Edge when `require-trusted-types-for` is enabled in CSP header
- Dominant language
- Elm
- Stars
- 1.3k
- Forks
- 72
- Avg merge
- 21h 30m
- Merged PRs (30d)
- 1
Description
When `require-trusted-types-for: 'script'` is enabled in the Content Security Policy (CSP), the site fails to render in Edge and Chrome.

Presumably this happens because the scripts inject raw strings into the DOM rather than appending typed values to the DOM. See [the MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/require-trusted-types-for).
The site renders in Safari and Firefox because those browsers do not yet support the `require-trusted-types-for` directive. Presumably they will support in the future, however.
Contributor guide
Research direction
Reproduce the rendering failure in Chrome or Edge with require-trusted-types-for: 'script' enabled, then trace the scripts that inject raw strings into the DOM. Confirm the fix by loading the site under that CSP in both browsers while preserving the existing rendering behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elm, javascript
- Domain
- frontend, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100