Gecko to CEF

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Gecko to CEF

Postby tslate » Wed Jul 19, 2017 1:10 pm

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.
tslate
Techie
 
Posts: 32
Joined: Wed Jul 19, 2017 12:47 pm

Re: Gecko to CEF

Postby magreenblatt » Wed Jul 19, 2017 1:28 pm

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.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 21 guests