Click or drag to resize
ChromiumWebBrowserRegisterAsyncJsObject Method
Version 51.0.0

Asynchronously registers a Javascript object in this specific browser instance.

Only methods of the object will be availabe.

Namespace: CefSharp.WinForms
Assembly: CefSharp.WinForms (in CefSharp.WinForms.dll) Version: 51.0.0.0 (51.0.0.0)
Syntax
public void RegisterAsyncJsObject(
	string name,
	Object objectToBind,
	bool camelCaseJavascriptNames = true
)

Parameters

name
Type: SystemString
The name of the object. (e.g. "foo", if you want the object to be accessible as window.foo).
objectToBind
Type: SystemObject
The object to be made accessible to Javascript.
camelCaseJavascriptNames (Optional)
Type: SystemBoolean
camel case the javascript names of methods, defaults to true

Implements

IWebBrowserRegisterAsyncJsObject(String, Object, Boolean)
Exceptions
ExceptionCondition
ExceptionBrowser is already initialized. RegisterJsObject must be + called before the underlying CEF browser is created.
Remarks
The registered methods can only be called in an async way, they will all return immeditaly and the resulting object will be a standard javascript Promise object which is usable to wait for completion or failure.
See Also