Table of Contents

Method Invoke

Namespace
DotNetBrowser.Js
Assembly
DotNetBrowser.dll

Invoke<T>(IJsObject, params object[])

Executes the function on the given jsObject with the args. This method blocks current thread execution until the function finishes its execution. If the function raises an exception, then a JsException with an error message that describes the reason of the exception will be thrown. Same error message will be printed in JavaScript Console.

T Invoke<T>(IJsObject jsObject, params object[] args)

Parameters

jsObject IJsObject

The JavaScript object to invoke this function on. Pass null to invoke the function as a global function.

args object[]

The list of input arguments. The following types are supported: bool, double, string, IJsObject, or object.

Returns

T

The result of the JavaScript function execution.

Type Parameters

T

The expected type of the result of the JavaScript function execution

Exceptions

JsException

The JavaScript function raised an exception.

ObjectDisposedException

The IJsFunction has already been disposed.

ConnectionClosedException

The connection to the Chromium engine is closed.

Invoke(IJsObject, params object[])

Executes the function on the given jsObject with the args. This method blocks current thread execution until the function finishes its execution. If the function raises an exception, then JsException with an error message that describes the reason of the exception will be thrown. Same error message will be printed in JavaScript Console.

object Invoke(IJsObject jsObject, params object[] args)

Parameters

jsObject IJsObject

The JavaScript object to invoke this function on. Pass null to invoke the function as a global function.

args object[]

The list of input arguments. The following types are supported: bool, double, string, IJsObject, or object.

Returns

object

The result of the JavaScript function execution.

Exceptions

JsException

The JavaScript function raised an exception.

ObjectDisposedException

The IJsFunction has already been disposed.

ConnectionClosedException

The connection to the Chromium engine is closed.