Page 1 of 1

Gecko to CEF

PostPosted: Wed Jul 19, 2017 1:10 pm
by tslate
Hi,

I'm beginning the process of converting a C++ Gecko application to CEF. After reviewing the documentation I think everything will work fine except for the DOM manipulation. Since every thread I've read on the internet basically states the same thing, ie that CEF does not support direct DOM manipulation and JS/V8 is the only option.

The DOM manipulations in the application I'm converting are quite extensive, so without full knowledge of the CEF bindings to JS, I'm assuming that pushing JS to manipulate the DOM is not going to be an issue. based on reviewing the JS Integration documentation. However even to do that I'll still need references to all the HTML objects on a page/form being manipulated, so not sure if that's trivial/do-able with CEF.

For a trivial example for every text area on a form I need to blank it out and perform other actions on each, say change the font. I'll need to get a reference to each text area to perform these actions. Same example, but now need to parse the text of each text area, etc. Are these straightforward using CEF?

In other words, basically own the DOM, how trivial or complicated is this in CEF?

Thanks for your help.

Re: Gecko to CEF

PostPosted: Wed Jul 19, 2017 1:28 pm
by magreenblatt
Changing the DOM using JS/CSS should be easy to implement. I would suggest doing most of the work with JS/CSS and triggering from C++ using CefFrame::ExecuteJavaScript (from the browser process) or CefV8Context::Eval (from the renderer process) as necessary.