RequestCurrentHtml
Interface AntViewDocument
Type: Method
Parameters: none
Returns: nothing
Requests the control to retrieve the html of the top level document currently rendered.
Note that this might not include frames.
In particular, if you have a frame that is in a different domain then by default security rules will prevent your javascript to access (or read) any of the html elements in that frame.
For access to frames, use OnFrameCreated and the AntViewFrame interface.
After the content is retrieved it will return the result in the OnRequestCurrentHtml event.
There's also a synchronous alternative RequestCurrentHtmlSync that wraps the above into one call and immediately returns the html.
Please note that you always need to connect the document object to the WebView2 control with the CurrentBrowser method before you use this method.
Example:
AntView - The MS Edge WebView2 ActiveX control Date last changed: 09/25/2024