Click or drag to resize
IJavascriptObjectRepositoryRegister Method
Version 63.0.0
Register an object for binding in Javascript. You can either register an object in advance or as part of the ResolveObject event that will be called if no object matching object is found in the registry. Objects binding is now initiated in Javascript through the CefSharp.BindObjectAsync function (returns a Promose). For more detailed examples see https://github.com/cefsharp/CefSharp/issues/2246 The equivilient to RegisterJsObject is isAsync = false The equivilient RegisterAsyncJsObject is isAsync = true

Namespace: CefSharp
Assembly: CefSharp (in CefSharp.dll) Version: 63.0.0.0 (63.0.0.0)
Syntax
void Register(
	string name,
	Object objectToBind,
	bool isAsync = false,
	BindingOptions options = null
)

Parameters

name
Type: SystemString
object name
objectToBind
Type: SystemObject
the object that will be bound in javascript
isAsync (Optional)
Type: SystemBoolean
if true the object will be registered for async communication, only methods will be exposed and when called from javascript will return a Promise to be awaited. This method is newer and recommended for everyone starting out as it is faster and more reliable. If false then methods and properties will be registered, this method relies on a WCF service to communicate.
options (Optional)
Type: CefSharpBindingOptions
binding options, by default method/property names are camelCased, you can control this and other advanced options though this class.
See Also