Page 1 of 1

How to track when page is completely loaded?

Posted: Fri Jun 16, 2017 12:56 pm
by voltov
Hello,

When I'm trying to load a website (e.g.: youtube.com) I can see, that TChromium.OnLoadEnd() is called 4 times. On other websites - it may be called less or more times.

Is there a callback or property or any tool that indicates that page is completely loaded?

Re: How to track when page is completely loaded?

Posted: Fri Jun 16, 2017 1:45 pm
by salvadordf
This is what the code comments found in the file /include/capi/cef_load_handler_capi.h say about that event :

Code: Select all

  ///
  // Called when the browser is done loading a frame. The |frame| value will
  // never be NULL -- call the is_main() function to check if this frame is the
  // main frame. Multiple frames may be loading at the same time. Sub-frames may
  // start or continue loading after the main frame load has ended. This
  // function will not be called for same page navigations (fragments, history
  // state, etc.) or for navigations that fail or are canceled before commit.
  // For notification of overall browser load status use OnLoadingStateChange
  // instead.
  ///
Some web pages have several frames and you should call frame.IsMain to know if that event corresponds to the page and not to a frame included in that page.

Re: How to track when page is completely loaded?

Posted: Fri Jun 16, 2017 1:58 pm
by voltov
Works! Thank you!