WebInitScript
Namespace: E2E.Engine
public sealed class WebInitScriptA script every document runs before the page’s own, in every tab and frame: JavaScript source, a file of it, or a function source the page calls. A string converts to source.
Inheritance: object
Properties
Section titled “Properties”Function
Section titled “Function”public string? Function { get; }The source of a function the page calls, such as () => { ... },
or <a href=“https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a> for source or a file. It cannot close over test
variables; Browser.AddInitScriptAsync passes it one JSON argument.
Value: string
public string? Path { get; }The file of JavaScript source, relative to the project root, or <a href=“https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a> for source or a function.
Value: string
Source
Section titled “Source”public string? Source { get; }The JavaScript source, or <a href=“https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a> for a file or a function.
Value: string
Methods
Section titled “Methods”FromFunction(string)
Section titled “FromFunction(string)”public static WebInitScript FromFunction(string function)Parameters
| Name | Type | Description |
|---|---|---|
function |
string |
Returns: WebInitScript
FromPath(string)
Section titled “FromPath(string)”public static WebInitScript FromPath(string path)Parameters
| Name | Type | Description |
|---|---|---|
path |
string |
Returns: WebInitScript
FromSource(string)
Section titled “FromSource(string)”public static WebInitScript FromSource(string source)Parameters
| Name | Type | Description |
|---|---|---|
source |
string |
Returns: WebInitScript
Operators
Section titled “Operators”implicit operator WebInitScript(string)
Section titled “implicit operator WebInitScript(string)”public static implicit operator WebInitScript(string source)Parameters
| Name | Type | Description |
|---|---|---|
source |
string |
Returns: WebInitScript