Not TestedTesting not done, may not work properly
HTML & DOM Security

Trusted Script URL

Validate external script URL origins using TrustedScriptURL policies.

Checking support...
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