Page 1 of 1

Full load page

Posted: Sat Aug 24, 2019 1:00 pm
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.

Re: Full load page

Posted: Sat Aug 24, 2019 1:43 pm
by salvadordf

Re: Full load page

Posted: Sat Aug 24, 2019 1:59 pm
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.

Re: Full load page

Posted: Sat Aug 24, 2019 2:17 pm
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.

Re: Full load page

Posted: Sat Aug 24, 2019 2:21 pm
by X11
Yes, I know about frame.IsMain, but how ignore the error.
Due to an error, I have to wait 1-2 minutes...

Re: Full load page

Posted: Sat Aug 24, 2019 2:28 pm
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