Javascript Evaluation generate fatal error

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.

Javascript Evaluation generate fatal error

Postby qberthet » Wed Nov 06, 2019 9:41 am

I'm trying to get html element size and position with getBoundingClientRect function on my element. I have this code running in my Render Process :
Code: Select all
void OnContextCreated(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context) override
{
    CefRefPtr<CefV8Value> retval;
    CefRefPtr<CefV8Exception> exception;
    bool success = context->Eval("(document.getElementsByClassName('myClass')[0].getBoundingClientRect())", CefString(), 0, retval, exception);
    /* stuff with retval */
}


This raises leads to a crash only when using the getBoundingClientRect function.
The code crash with the following message : [1106/144536.226:FATAL:LayoutTreeBuilder.h(66)] Check failed: node.InActiveDocument().

I am using 3202 cef version.
qberthet
Newbie
 
Posts: 5
Joined: Thu Oct 03, 2019 7:56 am

Re: Javascript Evaluation generate fatal error

Postby ndesktop » Wed Nov 06, 2019 10:55 am

Maybe the collection document.getElementsByClassName('myClass') is empty and [0] crashes instead?
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: Javascript Evaluation generate fatal error

Postby qberthet » Thu Nov 07, 2019 4:57 am

I've updated the cef version, fixes all the bugs it creates and finally get a javascript error so yeah, at that point the request couldn't give me the element. I postponed the request after the client loading finished and it worked well.
qberthet
Newbie
 
Posts: 5
Joined: Thu Oct 03, 2019 7:56 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 87 guests