]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/webview_webkit.mm
make sure we don't execute pending deletes either when in runModel, otherwise reentra...
[wxWidgets.git] / src / osx / webview_webkit.mm
index 018dacf3f59592ef9d12e8376bffa9d983c6c3f3..9659efdb082e97f570a10573e0f2ef237522bda5 100644 (file)
@@ -909,16 +909,16 @@ wxString wxWebViewWebKit::GetSelectedSource() const
                        "var element = document.createElement('div');"
                        "element.appendChild(range.cloneContents());"
                        "return element.innerHTML;");
-    id result = [[m_webView windowScriptObject]
-                   evaluateWebScript:wxNSStringWithWxString(script)];
-    return wxStringWithNSString([result stringValue]);
+    NSString *result = [m_webView stringByEvaluatingJavaScriptFromString:
+                                  wxNSStringWithWxString(script)];
+    return wxStringWithNSString(result);
 }
 
 wxString wxWebViewWebKit::GetPageText() const
 {
-    id result = [[m_webView windowScriptObject]
-                 evaluateWebScript:@"document.body.textContent"];
-    return wxStringWithNSString([result stringValue]);
+    NSString *result = [m_webView stringByEvaluatingJavaScriptFromString:
+                                  @"document.body.textContent"];
+    return wxStringWithNSString(result);
 }
 
 void wxWebViewWebKit::EnableHistory(bool enable)