Class TrustedScript
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The TrustedScript interface of the {{domxref("Trusted Types API", "", "", "nocode")}} represents a string with an uncompiled script body that a developer can insert into an injection sink that might execute the script. These objects are created via CreateScript(string, params dynamic[]) and therefore have no constructor.
[Value("TrustedScript")]
public class TrustedScript
- Inheritance
-
TrustedScript
- Inherited Members
Remarks
The value of a TrustedScript object is set when the object is created and cannot be changed by JavaScript as there is no setter exposed.
-Prevent DOM-based cross-site scripting vulnerabilities with Trusted Types
Constructors
TrustedScript()
public TrustedScript()
Methods
ToJSON()
The toJSON() method of the TrustedScript interface returns a JSON representation of the stored data.
[Value("toJSON")]
public string ToJSON()
Returns
- string
A string containing a JSON representation of the stored data.