Returning Objects from ConsoleMessage

Having problems with building or using the CefSharp .NET binding? Ask your CEF-related questions here. Please ask general usage questions on StackOverflow.

Moderator: amaitland

Returning Objects from ConsoleMessage

Postby Sagan » Wed Jul 20, 2022 1:54 am

Hey Everyone,

I'm writing an application that's currently parsing console messages looking for certain events being passed to the browser.
When observing the console in Chrome, Edge, Firefox etc... some of the entries are returning values that can be expanded (appears to be a JSON object of some type):

Image

However CEF only returns a String in the ConsoleMessage event. Those JSON entries just show up as:

Code: Select all
scripter: WS Body:  [object Object]


Is there any way to get more detailed information from this kind of response via any other kind of output?
Sagan
Newbie
 
Posts: 2
Joined: Wed Jul 20, 2022 1:18 am

Re: Returning Objects from ConsoleMessage

Postby magreenblatt » Wed Jul 20, 2022 10:00 am

Are you in control of what gets logged? If so, write the event contents as JSON or similar using console.log().
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Returning Objects from ConsoleMessage

Postby Sagan » Wed Jul 20, 2022 6:46 pm

magreenblatt wrote:Are you in control of what gets logged? If so, write the event contents as JSON or similar using console.log().


Nah unfortunately I'm not in control of this. It's an external service.

I have a feeling I'm going to be out of luck with this one, unless I can inject some kind of JavaScript to collect events. I'm not a highly proficient web developer unfortunately, not my usual area of expertise.

Edit: I'm starting to look into the DevToolsClient, although documentation seems a little light. I'm hoping there's some way to capture that information inside there somewhere.
Sagan
Newbie
 
Posts: 2
Joined: Wed Jul 20, 2022 1:18 am


Return to CefSharp Forum

Who is online

Users browsing this forum: No registered users and 12 guests