Implement GetPageSource() and GetPageText()
This commit is contained in:
@@ -285,7 +285,7 @@ public:
|
||||
<a href="https://docs.microsoft.com/en-us/microsoft-edge/hosting/webview2">Edge WebView2</a>.
|
||||
It is available for Windows 7 and newer.
|
||||
The following features are currently unsupported with this backend:
|
||||
virtual filesystems, custom urls, find, source code.
|
||||
virtual filesystems, custom urls, find.
|
||||
|
||||
This backend is not enabled by default, to build it follow these steps:
|
||||
- Visual Studio 2015, or newer, is required
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user