Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

TTMSFMXWebBrowser after rendering

 Post Reply Post Reply
Author
Kraemer Guenter View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 May 2014
Posts: 197
Post Options Post Options   Quote Kraemer Guenter Quote  Post ReplyReply Direct Link To This Post Topic: TTMSFMXWebBrowser after rendering
    Posted: 02 Oct 2019 at 12:17pm
How do I know that the browser is done rendering the page so I can access the html via the Document property?
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3392
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 02 Oct 2019 at 1:21pm
With the following code, you are able to detect when a page is loaded, for Windows. For the other platforms, more investigation is needed.

function TForm62.ReadyState: string;
var
  pDoc: IHTMLDocument2;
  ie: IWebBrowser2;
begin
  Result := '';
  ie := IWebBrowser2(TMSFMXWebBrowser1.GetWebBrowserInstance);
  if Assigned(ie) and Assigned(ie.Document) then
  begin
    pDoc := ie.Document as IHtmlDocument2;
    Result := pDoc.readyState;
  end;
end;
Back to Top
Kraemer Guenter View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 May 2014
Posts: 197
Post Options Post Options   Quote Kraemer Guenter Quote  Post ReplyReply Direct Link To This Post Posted: 02 Oct 2019 at 6:54pm
So there is no event triggered when its done, means, I need to keep on polling? That would be bad.
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3392
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 03 Oct 2019 at 8:31am
There is currently no event. We'll investigate the possibilities.
Back to Top
Kraemer Guenter View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 May 2014
Posts: 197
Post Options Post Options   Quote Kraemer Guenter Quote  Post ReplyReply Direct Link To This Post Posted: 06 Oct 2019 at 7:24pm
Thats a disappointment, so its only half-baked. It makes no sense to keep on polling only to check the status.
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3392
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 07 Oct 2019 at 8:53am
As already mentioned, we'll investigate the possibilities. Please note that this is not as straightforward, as it needs to be handled for multiple platforms/multiple operating system combinations.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down