I have a goal to get the elements of a webpage using Javascript in to C++ variables. I've read the best method of working with the DOM is JS.
However I little experience with JS and the v8 contexts in CEF. Any suggestions on an approach are appreciated. The setup I have now is similar to below:
- Code: Select all
struct element
{
int width ;
int length;
int x; // top left
int y; // top left
};
std::stack<element> elements ;
- Code: Select all
for (int x = 0; domElements.getLength(); x++)
{
element div;
div.width = var.width() // What I need help on
div.length = var.height()
div ...etc.
elements.push(div);
}
From here I would like to put the element dimensions returned from JS into the C++ element object. Or by some other method return a JS object that can be used by C++ methods.
I've read through https://bitbucket.org/chromiumembedded/ ... ntegration
But its still unclear to me on exactly what my approach should be. I'm a beginner on the JS side of things and CEF I'm just breaking into.
Any help on this would be greatly appreciated! Thanks in advance!