Speculative fix for wxWebView unit tests on OSX.
Use stringByEvaluatingJavaScriptFromString as it is guaranteed to return an NSString. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -909,16 +909,16 @@ wxString wxWebViewWebKit::GetSelectedSource() const
|
|||||||
"var element = document.createElement('div');"
|
"var element = document.createElement('div');"
|
||||||
"element.appendChild(range.cloneContents());"
|
"element.appendChild(range.cloneContents());"
|
||||||
"return element.innerHTML;");
|
"return element.innerHTML;");
|
||||||
id result = [[m_webView windowScriptObject]
|
NSString *result = [m_webView stringByEvaluatingJavaScriptFromString:
|
||||||
evaluateWebScript:wxNSStringWithWxString(script)];
|
wxNSStringWithWxString(script)];
|
||||||
return wxStringWithNSString([result stringValue]);
|
return wxStringWithNSString(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxWebViewWebKit::GetPageText() const
|
wxString wxWebViewWebKit::GetPageText() const
|
||||||
{
|
{
|
||||||
id result = [[m_webView windowScriptObject]
|
NSString *result = [m_webView stringByEvaluatingJavaScriptFromString:
|
||||||
evaluateWebScript:@"document.body.textContent"];
|
@"document.body.textContent"];
|
||||||
return wxStringWithNSString([result stringValue]);
|
return wxStringWithNSString(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWebViewWebKit::EnableHistory(bool enable)
|
void wxWebViewWebKit::EnableHistory(bool enable)
|
||||||
|
Reference in New Issue
Block a user