Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

How to track when page is completely loaded?

Post Reply
voltov
Posts: 14
Joined: Tue Jun 13, 2017 11:01 am

How to track when page is completely loaded?

Post 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?
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to track when page is completely loaded?

Post 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.
voltov
Posts: 14
Joined: Tue Jun 13, 2017 11:01 am

Re: How to track when page is completely loaded?

Post by voltov »

Works! Thank you!
Post Reply