-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
- What steps will reproduce the problem?
- Create browser in code
- Bind object using browser.RegisterJsObject
- add browser to a WPF control and let it render
- Attempt to call a method on the object
- What is the expected output? What do you see instead?
Expected output would be nothing, as the method in question is a void type. I get the following error instead
salesbookBridge.invokeBloombergCommand("","","") < -- Invocation call, in DevTools (same thing happens when using JSFiddle)
VM187:2 Uncaught Error: System.NullReferenceException: Object reference not set to an instance of an object.
at CefSharp.JavascriptMethodWrapper.Execute(Object[] parameters)
at CefSharp.JavascriptMethodHandler.Execute(JavascriptMethodHandler* , CefStringBase<CefStringTraitsUTF16>* name, CefRefPtr<CefV8Value>* object, vector<CefRefPtr<CefV8Value>\,std::allocator<CefRefPtr<CefV8Value> > >* arguments, CefRefPtr<CefV8Value>* retval, CefStringBase<CefStringTraitsUTF16>* exception)
at CefSharp.JavascriptMethodWrapper.Execute(Object[] parameters)
at CefSharp.JavascriptMethodHandler.Execute(JavascriptMethodHandler* , CefStringBase<CefStringTraitsUTF16>* name, CefRefPtr<CefV8Value>* object, vector<CefRefPtr<CefV8Value>\,std::allocator<CefRefPtr<CefV8Value> > >* arguments, CefRefPtr<CefV8Value>* retval, CefStringBase<CefStringTraitsUTF16>* exception)
at Error (native)
at <anonymous>:2:17
at Object.InjectedScript._evaluateOn (<anonymous>:875:140)
at Object.InjectedScript._evaluateAndWrap (<anonymous>:808:34)
at Object.InjectedScript.evaluate (<anonymous>:664:21)
- Are you using
WinForms,WPForOffScreen?
WPF - What version of the product are you using? On what operating system? x86 or x64?
x86 v47.0.3- What version are you using? Nuget? CI Nuget? build from a branch? If so which branch?
Nuget 47.0.3 - Win7, Win 8, Win10, etc?
Win7
- What version are you using? Nuget? CI Nuget? build from a branch? If so which branch?
Execution doesn't come into my managed code at all. I'm using VS2012 so I can't compile from source or debug into CefSharp.WPF as compilation is not supported in 2012 anymore
There is nothing in the debug.log file at all related to this, attempting to execute the method writes nothing to the file
It's worth noting that it does appear to find the method, as changing the call to use a non-existent method name gives a different error ("not a function"). My C# code is fairly simple
var browser = new ChromiumWebBrowser();
if (BoundObject != null)
browser.RegisterJsObject("salesbookBridge", BoundObject);
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
browser.FrameLoadEnd += FrameLoaded;
BindingOperations.SetBinding(browser, ChromiumWebBrowser.AddressProperty,
new Binding("ContainerElement.URL"));
this.AssociatedObject.Child = browser; <- adding the browser to a Border for rendering`
Metadata
Metadata
Assignees
Labels
No labels