LoadingStateChange not behaving as expected

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.

LoadingStateChange not behaving as expected

Postby vitorroriz » Mon Jul 19, 2021 5:43 am

Dear community,

The following behavior was experienced in both libcef versions 3.3440.1805 (Chromium 68) and 91.1.21 (Chromium 91.0.4472).

I want that a given browser instance is just visible after <target_url> has finished loading, for that I'm using OnLoadingStateChange to trigger an internal message that will result on setting browser visible. However, I can, sometimes, for a very short time (in the order of 100's ms) still see the former loaded URL in the browser. To set visibility true, I'm checking that isLoading == false, and I'm verifying that GetURL() == <target_url>.

While searching about it, I've found an old thread on CEF C# repo that seems to be related (https://github.com/cefsharp/CefSharp/issues/1406), however I'm not sure if it applies.

Would someone have some suggestion?

Thank you!
vitorroriz
Newbie
 
Posts: 2
Joined: Mon Jul 19, 2021 4:49 am

Re: LoadingStateChange not behaving as expected

Postby HarmlessDave » Tue Jul 20, 2021 7:58 pm

LoadingStateChange says that the main page HTML has been fetched, but only that. Any includes such as images, CSS, scripts, frames, iframes may still be loading. Script code may be running that will add to the page. Some sites might load almost nothing as the main page and do all of the real work through includes and frames or AJAX and the process can take time.

You can get an idea of how complicated a page is by using F12 in Google Chrome and looking at the Network tab.
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: LoadingStateChange not behaving as expected

Postby vitorroriz » Tue Nov 16, 2021 8:51 am

Hi @HarmlessDave, I'm really sorry, but I totally missed your message.

I'm aware not all resources are loaded at once and that LoadingStateChange is called several times. The issue here is of other kind, also because, if that was the problem a hack solution like loading about:blank temporarily would fix it, what doesn't happen. The thing is, no matter which event I use (AddressChange or later LoadingStateChange), everytime I set the document visible again, I'll see the previous URL for a short time. It is like if, although URL is already fetched, the action of displaying pages will just start once the page is visible.
vitorroriz
Newbie
 
Posts: 2
Joined: Mon Jul 19, 2021 4:49 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 25 guests