using System;
using System.Threading.Tasks;
namespace WebViewControl {
partial class WebView {
///
/// Registers an object with the specified name in the window context of the browser
///
/// Name of the object that will be available on the JS window context.
/// .Net object instance that will be bound to the JS proxy object.
/// Optional method that allows intercepting every call.
/// True if the object was registered or false if the object was already registered before
public bool RegisterJavascriptObject(string name, object objectToBind, Func, object> interceptCall = null) {
if (interceptCall == null) {
interceptCall = target => target();
}
return InnerRegisterJavascriptObject(name, objectToBind, interceptCall);
}
///
/// Registers an object with the specified name in the window context of the browser.
/// Use this overload with async interceptor methods.
///
/// Name of the object that will be available on the JS window context.
/// .Net object instance that will be bound to the JS proxy object.
/// Async method that allows intercepting every call.
/// True if the object was registered or false if the object was already registered before
public bool RegisterJavascriptObject(string name, object objectToBind, Func, Task