Hi,
how I can check, if the webbrowser finish with loading the site?
(ReadyState?)
Hi,
how I can check, if the webbrowser finish with loading the site?
(ReadyState?)
Hi,
You can use the following code, with a timer, periodically checking the readyState.
procedure TForm1.Button1Click(Sender: TObject);
begin
Timer1.Enabled := True;
AdvWebBrowser1.URL := 'http://www.tmssoftware.com';
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
AdvWebBrowser1.ExecuteJavascript('function test(){return document.readyState}test();',
procedure(const AValue: string)
begin
if LowerCase(StringReplace(AValue, '"', '', [rfReplaceAll])) = 'complete' then
begin
TAdvUtils.Log('document complete for ' + TMSFNCWebBrowser1.URL);
Timer1.Enabled := False;
end;
end
);
end;