Table of Contents

Interface IJsFunction

Namespace
DotNetBrowser.Js
Assembly
DotNetBrowser.dll

A JavaScript function that can be passed between .NET and JavaScript as a method argument or a return value. The function lifetime is bound to the lifetime of the frame this function belongs to. When the owner frame is unloaded, all the JavaScript objects are automatically disposed. An attempt to access a disposed JavaScript object will result in ObjectDisposedException

public interface IJsFunction : IJsObject, IAutoDisposable
Inherited Members
Extension Methods

Remarks

This API is available since DotNetBrowser 2.1.

Methods

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.

InvokeAsync(IJsObject, params object[])

Asynchronously executes the function on the given jsObject with the args without blocking the current thread.

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

Asynchronously executes the function on the given jsObject with the args without blocking the current thread.

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.