TrustedTypePolicy: name property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Note: This feature is available in Web Workers.
The name
read-only property of the TrustedTypePolicy
interface returns the name of the policy.
Value
A string containing the name of the policy.
Examples
In the below example a policy called myEscapePolicy
is created using TrustedTypePolicyFactory.createPolicy()
and is represented by the object escapeHTMLPolicy
. Calling name
on this object returns the string "myEscapePolicy".
js
const escapeHTMLPolicy = trustedTypes.createPolicy("myEscapePolicy", {
createHTML: (string) => string.replace(/</g, "<"),
});
console.log(escapeHTMLPolicy.name); /* "myEscapePolicy" */
Specifications
Specification |
---|
Trusted Types # dom-trustedtypepolicy-name |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.