HTML & DOM Security
Trusted Script
Create and inspect TrustedScript objects for safe inline script execution.
Checking support...
Feature Not SupportedThis browser does not support the Trusted Script Web API feature. Try testing in a modern browser (such as Chrome, Edge, Safari, or Firefox).
Advertisement
Interactive Input Workspace
Ready for input
Web API Execution Output
Result output will be displayed here after processing...
Native JavaScript Code Example (Zero Libraries)
const scriptPolicy = trustedTypes.createPolicy('myScriptPolicy', {
createScript: string => string
});About the Trusted Script Web API
TrustedScript objects ensure dynamic script strings originate from verified application policies.
Specification:W3C & WHATWG Web API Standard
Sponsored Content