TrustedTypePolicy Class
https://w3c.github.io/trusted-types/dist/spec/#trusted-type-policy: creates trusted types by applying the rules of the callbacks given to TrustedTypePolicyFactory.CreatePolicy.
public sealed class TrustedTypePolicyProperties
| Name | Description |
|---|---|
| Name | Gets the name of the policy. |
Name
TrustedTypes.csMethods
| Name | Description |
|---|---|
| CreateHtml(string, object?[]) | https://w3c.github.io/trusted-types/dist/spec/#dom-trustedtypepolicy-createhtml |
| CreateParserOptions(SetHtmlUnsafeOptions?, object?[]) | https://w3c.github.io/trusted-types/dist/spec/#dom-trustedtypepolicy-createparseroptions: the TrustedHtmlParserOptions created from the options returned by the createParserOptions callback. |
| CreateScript(string, object?[]) | https://w3c.github.io/trusted-types/dist/spec/#dom-trustedtypepolicy-createscript |
| CreateScriptUrl(string, object?[]) | https://w3c.github.io/trusted-types/dist/spec/#dom-trustedtypepolicy-createscripturl |
CreateHtml(string, object?[])
TrustedTypes.cshttps://w3c.github.io/trusted-types/dist/spec/#dom-trustedtypepolicy-createhtml
public TrustedHtml CreateHtml(string input, params object?[] arguments)Parameters
inputstringargumentsobject?[]
Returns
Exceptions
TypeErrorException- The policy has no
createHTMLcallback.
See also
CreateParserOptions(SetHtmlUnsafeOptions?, object?[])
TrustedTypes.cshttps://w3c.github.io/trusted-types/dist/spec/#dom-trustedtypepolicy-createparseroptions: the TrustedHtmlParserOptions created from the options returned by the createParserOptions callback.
public TrustedHtmlParserOptions CreateParserOptions(SetHtmlUnsafeOptions? options = null, params object?[] arguments)Parameters
optionsSetHtmlUnsafeOptions?argumentsobject?[]
Returns
Exceptions
TypeErrorException- The policy has no
createParserOptionscallback, or the callback returned null.
See also
CreateScript(string, object?[])
TrustedTypes.cshttps://w3c.github.io/trusted-types/dist/spec/#dom-trustedtypepolicy-createscript
public TrustedScript CreateScript(string input, params object?[] arguments)Parameters
inputstringargumentsobject?[]
Returns
Exceptions
TypeErrorException- The policy has no
createScriptcallback.
See also
CreateScriptUrl(string, object?[])
TrustedTypes.cshttps://w3c.github.io/trusted-types/dist/spec/#dom-trustedtypepolicy-createscripturl
public TrustedScriptUrl CreateScriptUrl(string input, params object?[] arguments)Parameters
inputstringargumentsobject?[]
Returns
Exceptions
TypeErrorException- The policy has no
createScriptURLcallback.