Replies: 1 comment
-
Already asked at https://stackoverflow.com/q/75648905/4583726 Please just ask your question once and wait for a reply. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to bind .net object to javascript code in wpf application using cefsharf library
.net code
webBrowser.JavascriptobjectRepository.Registry("jsobject",new
BoundObject(),true);
webBrowser.IsBrowserInitializedChanged +=
browser_IsBrowserInitializedChanged();
webBrowser.LoadingStateChanged += browser_LoadingStateChanged();
public class BoundObject
{
public string AppId()
{ return "Id"}
public string AppCode()
{ return "Code"}
}
xamlcode
<cef:chromiumwWebbrowser x:name"webBrowser"/>
javascriptcode in html file
(async function(){ await cefsharp.BindObjectAsync("jsobject"); objappid = jsobject.AppId(); objappid = jsobject.AppCode(); })();
In html page getting error -> uncaught(in promise)Reference error: cefsharp is not defined
basically i am not able to fetch .net object methods(AppId and AppCode) in javascript code
I tried different things to bind like
`webBrowser.JavascriptobjectRepository.Resolveobject +=(sender,e)=>
{
// trying to register object here
}`
for everything getting same error
Beta Was this translation helpful? Give feedback.
All reactions