WebBrowserExtensionsRegisterAsyncJsObject Method |
Version 101.0.180 Note: This API is now obsolete.
Asynchronously registers a Javascript object in this specific browser instance.
Only methods of the object will be availabe.
Namespace:
CefSharp
Assembly:
CefSharp (in CefSharp.dll) Version: 101.0.180.0 (101.0.180.0)
Syntax [ObsoleteAttribute("This method has been removed, see https://github.com/cefsharp/CefSharp/issues/2990 for details on migrating your code.")]
public static void RegisterAsyncJsObject(
this IWebBrowser webBrowser,
string name,
Object objectToBind,
BindingOptions options = null
)
public:
[ExtensionAttribute]
[ObsoleteAttribute(L"This method has been removed, see https://github.com/cefsharp/CefSharp/issues/2990 for details on migrating your code.")]
static void RegisterAsyncJsObject(
IWebBrowser^ webBrowser,
String^ name,
Object^ objectToBind,
BindingOptions^ options = nullptr
)
Parameters
- webBrowser
- Type: CefSharpIWebBrowser
The browser to perform the registering on - 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. - options (Optional)
- Type: CefSharpBindingOptions
binding options - camelCaseJavascriptNames default to true
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IWebBrowser. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Exceptions Exception | Condition |
---|
Exception | Browser 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 immediately and the resulting
object will be a standard javascript Promise object which is usable to wait for completion or failure.
See Also