TrustedScriptURL interface of the
Trusted Types API represents a string that a developer can insert into an injection sink that will parse it as a URL of an external script. These objects are created via
TrustedTypePolicy.createScriptURL() and therefore have no constructor.
Returns a JSON representation of the stored data.
A string containing the sanitized URL.
sanitized is an object created via a Trusted Types policy.
const sanitized = scriptPolicy.createScriptURL( "https://example.com/my-script.js" ); console.log(sanitized); /* a TrustedScriptURL object */
|Trusted Types |
BCD tables only load in the browser