Page 1 of 1
ReadyState
Posted: Wed Sep 02, 2020 2:34 pm
by talentsoft
How can I access readystate value of the document?
wb.ChromiumBrowser.LoadURL('
www.google.com');
while ?????? <> READYSTATE_COMPLETE do
Application.HandleMessage;
// TODO others
Re: ReadyState
Posted: Wed Sep 02, 2020 9:33 pm
by Student
Event OnLoadEnd
Code: Select all
if frame.URL = 'www.google.com' then browser.MainFrame.ExecuteJavaScript('alert("Page is load!");', '', 0);
Re: ReadyState
Posted: Thu Sep 03, 2020 7:07 am
by salvadordf
You can use the TChromium.OnLoadEnd as Student said and you can also use the TChromium.OnLoadingStateChange event and check the "isLoading" parameter.
It's not recomended to use Application.ProcessMessages or Application.HandleMessage.
Almost all CEF events are executed in a CEF thread that it's different than the main application thread. Use synchronization objects to protect the data and send Windows messages to the main form to handle VCL controls in the main thread.