Is the directive supported by any user agent? If so, which?
TrustedTypes are available in Chrome 83, Edge 83 and a polyfill exists for browsers that don't currently support.
What are the valid values for the directive
require-trusted-types-for only allows script.
trusted-types allows a list of strings, including one 'allow-duplicates' which allows multiples of the same named policy to be created.
All PRs:
Adding a new CSP directive
This PR adds support for the TrustedTypes CSP directives,
require-trusted-types-for
and 'trusted-types'.Is the directive supported by any user agent? If so, which? TrustedTypes are available in Chrome 83, Edge 83 and a polyfill exists for browsers that don't currently support.
What does it do?
require-trusted-types-for
disallows using strings with DOM XSS injection sink functions (functions like Document.write, Element.InnerHtml), and requires matching types created by Trusted Type policies.What are the valid values for the directive
require-trusted-types-for
only allowsscript
.trusted-types
allows a list of strings, including one'allow-duplicates'
which allows multiples of the same named policy to be created.