How to achieve when document DOM is ready?

86 views
Skip to first unread message

Christian LeMoussel

unread,
Apr 17, 2015, 9:44:28 AM4/17/15
to cef...@googlegroups.com
Hi,

I use CefLoadHandler.OnLoadEnd event to achieve when HTml document complete loading.
But I'm not sure that the
DOM is ready.

Any idea on how to ensure that DOM is ready?

Dmitry Azaraev

unread,
Apr 17, 2015, 7:49:14 PM4/17/15
to cef...@googlegroups.com
Hi.

1. domready is not exists in nature. It is absolutely virtual. So did not wait that engine should implement it.
2. OnLoadEnd it is exactly main insertion point on which you should rely.
3. In OnLoadEnd event it is not a bad idea to post a CEF task to main thread, to give chance other messages to be processed. In this case it will be very similar to chromium's FrameLoadWaiter what are used in tests.

If it is still not enough (i'm discover some issues, but not remember that in exactly with same case), it is can be enforced via executing JS just for proper queuing (i.e. execute js with callback).

Alternative ideas:
Playing more with V8/JS, and expose callbacks based on JS events (like document.onload).


--
You received this message because you are subscribed to the Google Groups "CefGlue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cefglue+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Best regards,
   Dmitry

Christian LeMoussel

unread,
Apr 18, 2015, 2:36:04 AM4/18/15
to cef...@googlegroups.com, dmitry....@gmail.com
Dmitry, do you have some reference / Url  about Chromium's FrameLoadWaiter?

Dmitry Azaraev

unread,
Apr 18, 2015, 4:13:42 AM4/18/15
to cef...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages