Method ExecuteJavaScript
- Namespace
- DotNetBrowser.Frames
- Assembly
- DotNetBrowser.dll
ExecuteJavaScript<T>(string, bool)
Asynchronously executes JavaScript code using the current context and converts the execution result to the specified .NET type.
Task<T> ExecuteJavaScript<T>(string javaScript, bool userGesture = false)
Parameters
javaScript
stringThe JavaScript code.
userGesture
boolIndicates whether JavaScript is initiated by a user gesture.
Returns
- Task<T>
The task that can be used to wait for completion and obtain the result of the JavaScript execution.
Type Parameters
T
.NET type of the result
Exceptions
- ObjectDisposedException
The IFrame object has already been disposed.
- ArgumentException
The
javaScript
is null, empty, or contains only blank characters.
ExecuteJavaScript(string, bool)
Asynchronously executes JavaScript code using the current context.
Task<object> ExecuteJavaScript(string javaScript, bool userGesture = false)
Parameters
javaScript
stringThe JavaScript code to execute.
userGesture
boolIndicates whether JavaScript is initiated by a user gesture.
Returns
- Task<object>
The task that can be used to wait for completion and obtain the result of the JavaScript execution.
Exceptions
- ObjectDisposedException
The IFrame object has already been disposed.
- ArgumentException
The
javaScript
is null, empty, or contains only blank characters.