Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The HTTP Content-Security-Policy
(CSP) trusted-types
Experimental directive instructs user agents to restrict the creation of Trusted Types policies - functions that build non-spoofable, typed values intended to be passed to DOM XSS sinks in place of strings.
Together with require-trusted-types-for
directive, this allows authors to define rules guarding writing values to the DOM and thus reducing the DOM XSS attack surface to small, isolated parts of the web application codebase, facilitating their monitoring and code review. This directive declares an allow-list of trusted type policy names created with TrustedTypes.createPolicy
from Trusted Types API.