Skip to content

Synchronous Bindings in SelfHosted BrowserSubProcess #4562

@PKMNPlatin

Description

@PKMNPlatin

Is there an existing issue for this?

  • I have searched both open/closed issues, no issue already exists.

CefSharp Version

114.2.120

Operating System

Windows 11

Architecture

x64

.Net Version

4.5.2

Implementation

WinForms

Reproduction Steps

Fork the Minimal Example of CefSharp.WinForms and modify to run as SelfHosted Cef

Register one async and one sync object like:

m_browser.JavascriptObjectRepository.Register("syncObj", obj1, isAsync: false, options: BindingOptions.DefaultBinder);
m_browser.JavascriptObjectRepository.Register("asyncObj", obj2, isAsync: true, options: BindingOptions.DefaultBinder);

and call CefSharp.BindObjectAsync(); in JavaScript

The Async binding is created, the Sync one is nowhere to be found.

Expected behavior

Exposing the Sync-Binding to the global Window

Actual behavior

Only exposing the Async-Binding if using it as SelfHost

Regression?

No response

Known Workarounds

Haven't found one yet

Does this problem also occur in the CEF Sample Application

Not Tested

Other information

The cefclient application don't provide tests for JSBindings

From debug.log:

[0802/083647.102:ERROR:JavascriptRootObjectWrapper.cpp(37)] IBrowserProcess is null, unable to bind object testBinding

Only occurs Cef is running as SelfHosted Application

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions