Implement GetPageSource() and GetPageText()

This commit is contained in:
Tobias Taschner
2020-01-17 10:08:58 +01:00
parent ce968d0ecb
commit fb0e82e9d1
2 changed files with 7 additions and 5 deletions

View File

@@ -492,14 +492,16 @@ void wxWebViewEdge::Reload(wxWebViewReloadFlags WXUNUSED(flags))
wxString wxWebViewEdge::GetPageSource() const
{
// TODO: not implemented in SDK (could probably be implemented by script)
return wxString();
wxString text;
const_cast<wxWebViewEdge*>(this)->RunScript("document.documentElement.outerHTML;", &text);
return text;
}
wxString wxWebViewEdge::GetPageText() const
{
// TODO: not implemented in SDK (could probably be implemented by script)
return wxString();
wxString text;
const_cast<wxWebViewEdge*>(this)->RunScript("document.body.innerText;", &text);
return text;
}
bool wxWebViewEdge::IsBusy() const