Implement GetPageText for the OSX WebKit implementation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Steve Lamerton 2011-08-06 12:48:22 +00:00
parent ef53bf2a7b
commit c6ea1fdaf9
2 changed files with 8 additions and 1 deletions

View File

@ -58,7 +58,7 @@ public:
virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
virtual void Stop();
virtual wxString GetPageSource();
virtual wxString GetPageText() { return ""; }
virtual wxString GetPageText();
//We do not want to hide the other overloads
using wxWebView::SetPage;

View File

@ -920,6 +920,13 @@ void wxWebViewWebKit::ClearSelection()
RunScript("window.getSelection().removeAllRanges();");
}
wxString wxWebViewWebKit::GetPageText()
{
id result = [[m_webView windowScriptObject]
evaluateWebScript:@"document.body.textContent"];
return wxStringWithNSString([result stringValue]);
}
void wxWebViewWebKit::EnableHistory(bool enable)
{
if ( !m_webView )