CefFrame ExecuteJavaScript breaks my browser rendering.

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CefFrame ExecuteJavaScript breaks my browser rendering.

Postby Da1TruEcho » Sun Mar 05, 2017 10:12 pm

I'm pretty new to CEF so I apologize in advanced.

I'm using CEF 2883 in a multi process setup inside of a Windows MFC application. I have 1 Browser Process and 4 Render Processes. I'm calling ExecuteJavascript from the Browser process. I also have remote debugging enabled.

Calling ExecuteJavascript doesn't crash my appliction. It actually looks like it's doing what I want. The problem is, it's not rendering any of my changes. My intentions are to execute an eval to change the DOM. I can see the DOM changing in the debugger when the function is called. It's hitting all of my breakpoints, it's just not rendering UNTIL I RESIZE THE BROWSER. Even calling frame->ExecuteJavascript(_T("alert(\"test\")")); is causing this problem.

I used spy++ to take a look at the windows and I don't know if I found anything. There's a window called "Chrome Legacy Window" that's there before I call ExecuteJavascript. And it's gone after the call. It reappears if I resize the browser. I attached images of my spy++.

This is starting to drive me crazy. Any help would be greatly appreciated. Please let me know if I need to provide more information.
Attachments
NoRenderWidgetHost.png
This is right after the call to Execute Javascript
NoRenderWidgetHost.png (114.82 KiB) Viewed 3991 times
renderWidgetHost.png
This is before the call to Execute Javascript
renderWidgetHost.png (118.98 KiB) Viewed 3991 times
Da1TruEcho
Techie
 
Posts: 14
Joined: Sun Mar 05, 2017 9:42 pm

Re: CefFrame ExecuteJavaScript breaks my browser rendering.

Postby magreenblatt » Mon Mar 06, 2017 12:06 pm

Sounds like your renderer process might be crashing. Try attaching the Visual Studio debugger to the renderer processes before calling ExecuteJavaScript. You can get a symbolized call stack for the crash by downloading symbols (PDB file) from the same place you got the binary distribution, and placing the PDB file next to libcef.dll.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: CefFrame ExecuteJavaScript breaks my browser rendering.

Postby Da1TruEcho » Mon Mar 06, 2017 5:23 pm

Thanks for the reply! I found the culprit. I was trying to resize the browser window by calling SetWindowPos on the browser's window handle from the browser process right before the call to ExecuteJavascript.
Da1TruEcho
Techie
 
Posts: 14
Joined: Sun Mar 05, 2017 9:42 pm


Return to Support Forum

Who is online

Users browsing this forum: yuki and 52 guests