HTML & DOM Security
Trusted Script URL
Validate external script URL origins using TrustedScriptURL policies.
Checking support...
Feature Not SupportedThis browser does not support the Trusted Script URL 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 urlPolicy = trustedTypes.createPolicy('myUrlPolicy', {
createScriptURL: url => new URL(url, location.origin).href
});About the Trusted Script URL Web API
TrustedScriptURL restricts dynamic script loading sources to trusted origins.
Specification:W3C & WHATWG Web API Standard
Sponsored Content