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.

Full load page

Post Reply
X11
Posts: 49
Joined: Thu Jul 25, 2019 10:15 am

Full load page

Post by X11 »

Which event of TChromium is responsible for the full page load?
That is, after the entire page is fully loaded, I need to embed a script.

Code: Select all

Chromium1.Browser.MainFrame.ExecuteJavaScript(MemoJS.Text, Chromium1.Browser.MainFrame.Url, 0);

Thanx.
User avatar
salvadordf
Posts: 4565
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Full load page

Post by salvadordf »

X11
Posts: 49
Joined: Thu Jul 25, 2019 10:15 am

Re: Full load page

Post by X11 »

Thanx.
The isLoading is good.

But what to do if an error occurs during loading page and IsLoading always False.
example
https://doska.plus/chita/search/nedvizh ... 42595.html

Debug Output:
[0824/165233.182:ERROR:CEF4Delphi(1)] PID: 13204, TID: 12048, PT: Browser - Error code:-3 - Error text :'ERR_ABORTED' - URL:https://www.facebook.com/tr/

Process MiniBrowser.exe (13204)
How to ignore the error so that the page loads to the end?
I have to wait 2-3 minutes until the page loads :(


Sorry for my english.
User avatar
salvadordf
Posts: 4565
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Full load page

Post by salvadordf »

Use TChromium.OnLoadEnd and check frame.IsMain to see if the main frame has finished loading.

However, many pages have several frames and the TChromium.OnLoadEnd event is triggered multiple times.
The JavaScript code can also be used to alter the document when the user tries to scroll down, for example.

I'm afraid it's not possible to give a perfect solution to this.
X11
Posts: 49
Joined: Thu Jul 25, 2019 10:15 am

Re: Full load page

Post by X11 »

Yes, I know about frame.IsMain, but how ignore the error.
Due to an error, I have to wait 1-2 minutes...
User avatar
salvadordf
Posts: 4565
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Full load page

Post by salvadordf »

As far as I know, it's not possible to change the timeout values inside Chromium :
https://superuser.com/questions/633648/ ... -in-chrome
Post Reply