Skip to content

Conversation

@kingthorin
Copy link
Contributor

Adds directive and policy support for trusted-types and require-trusted-types-for, along with unit tests.

Fixes #4

Full disclosure copilot was leveraged in creating this code.

@kingthorin
Copy link
Contributor Author

According to grok Chrome (Edge based on Chromium) and Safari do support full ABNF for trusted-types policy names, I could expand test coverage if you like.

@rbri
Copy link
Member

rbri commented Jan 13, 2026

@kingthorin thanks for the contribution

I'm currently on the way to version 5.0, meaning JDK 17 and major HtmlUnit changes. But this might require some weeks. do you need this soon?

@kingthorin
Copy link
Contributor Author

No rush at all, I still have more work to do on this. I'll leverage it whenever it's released.

@kingthorin kingthorin marked this pull request as draft January 13, 2026 11:59
Signed-off-by: kingthorin <kingthorin@users.noreply.github.com>
@kingthorin
Copy link
Contributor Author

Note to self: Need to figure out where/how to track or handle this:

require-trusted-types-for alone → enforcement only, no restriction on names
trusted-types alone → restriction on names does nothing, enforcement inactive
trusted-types is meaningful only when require-trusted-types-for is also present

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.

Add support for trusted-types and require-trusted-types

2 participants