How do I know that the browser is done rendering the page so I can access the html via the Document property?
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;
So there is no event triggered when its done, means, I need to keep on polling? That would be bad.
There is currently no event. We'll investigate the possibilities.
Thats a disappointment, so its only half-baked. It makes no sense to keep on polling only to check the status.
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.