Table of Contents

Class TrustedTypePolicy

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The TrustedTypePolicy interface of the {{domxref("Trusted Types API", "", "", "nocode")}} defines a group of functions which create TrustedType objects.

[Value("TrustedTypePolicy")]
public class TrustedTypePolicy
Inheritance
TrustedTypePolicy
Inherited Members

Remarks

A TrustedTypePolicy object is created by CreatePolicy(string, TrustedTypePolicyOptions) to define a policy for enforcing security rules on input. Therefore, TrustedTypePolicy has no constructor.

See also on MDN

Constructors

TrustedTypePolicy()

public TrustedTypePolicy()

Properties

Name

The name read-only property of the TrustedTypePolicy interface returns the name of the policy.

[Value("name")]
public string Name { get; }

Property Value

string

A string containing the name of the policy.

Remarks

Methods

CreateHTML(string, params dynamic[])

The createHTML() method of the TrustedTypePolicy interface creates a TrustedHTML object using a policy created by CreatePolicy(string, TrustedTypePolicyOptions).

[Value("createHTML")]
public TrustedHTML CreateHTML(string input, params dynamic[] arguments)

Parameters

input string
arguments dynamic[]

Returns

TrustedHTML

A TrustedHTML object.

Remarks

CreateScript(string, params dynamic[])

The createScript() method of the TrustedTypePolicy interface creates a TrustedScript object using a policy created by CreatePolicy(string, TrustedTypePolicyOptions).

[Value("createScript")]
public TrustedScript CreateScript(string input, params dynamic[] arguments)

Parameters

input string
arguments dynamic[]

Returns

TrustedScript

A TrustedScript object.

Remarks

CreateScriptURL(string, params dynamic[])

The createScriptURL() method of the TrustedTypePolicy interface creates a TrustedScriptURL object using a policy created by CreatePolicy(string, TrustedTypePolicyOptions).

[Value("createScriptURL")]
public TrustedScriptURL CreateScriptURL(string input, params dynamic[] arguments)

Parameters

input string
arguments dynamic[]

Returns

TrustedScriptURL

A TrustedScriptURL object.

Remarks