Skip to content

Commit b5ce434

Browse files
committed
IJavascriptObjectRepository.ObjectBoundInJavascript - Fix bug and add example
1 parent cbde8a8 commit b5ce434

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,14 +478,15 @@ namespace CefSharp
478478
auto args = msg->GetArgumentList();
479479

480480
auto names = CefListValue::Create();
481-
args->SetList(0, names);
482481

483482
for (auto i = 0; i < javascriptObjects->Count; i++)
484483
{
485484
auto name = javascriptObjects[i]->JavascriptName;
486485
names->SetString(i, StringUtils::ToNative(name));
487486
}
488487

488+
args->SetList(0, names);
489+
489490
browser->SendProcessMessage(CefProcessId::PID_BROWSER, msg);
490491
}
491492
}

CefSharp.Wpf.Example/Views/BrowserTabView.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ public BrowserTabView()
3939
{
4040
repo.Register("boundAsync2", new AsyncBoundObject(), isAsync: true, options: bindingOptions);
4141
}
42+
};
43+
44+
browser.JavascriptObjectRepository.ObjectBoundInJavascript += (sender, e) =>
45+
{
46+
var name = e.ObjectName;
4247
};
4348

4449
browser.DisplayHandler = new DisplayHandler();

0 commit comments

Comments
 (0)