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.

ReadyState

Post Reply
talentsoft
Posts: 1
Joined: Wed Sep 02, 2020 2:31 pm

ReadyState

Post 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
Student
Posts: 72
Joined: Tue Aug 07, 2018 9:20 am

Re: ReadyState

Post by Student »

Event OnLoadEnd

Code: Select all

if frame.URL = 'www.google.com' then browser.MainFrame.ExecuteJavaScript('alert("Page is load!");', '', 0);
User avatar
salvadordf
Posts: 4040
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: ReadyState

Post 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.
Post Reply