Hi,
I'm using CEF1 (version 1.1180.832) on Windows7.
I want to resize my browser window according to it's body's height and width (DOM).
There are actually 2 parts for this question:
1 - Automatically detect body element size change
Whenever the DOM body size changes - I want to detect it immediately.
calling pDOMNode->AddEventListener("resize", ...) doesn't work for any DOM element (document\body\div...).
what I do right now, is visiting the DOM and checking the size of the body and see if it changed - every 250msec.
I don't like this way, but I can't think of any other method to do that.
suggestions?
2 - Query the page's document\body width and height
How can I query the size of the document (to resize the browser window accordingly)?
Right now I'm simply calling context->Eval with a script that returns the body size.
Here also there are a couple of problems. For example, when asking for document.body.offsetWidth - it doesn't include a vertical scrollbar.
Is there a better (and more efficient) way for querying the size without executing a script?
Thanks.