summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CyteKit/WebViewController.mm28
1 files changed, 2 insertions, 26 deletions
diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm
index 8c9a016..39103fb 100644
--- a/CyteKit/WebViewController.mm
+++ b/CyteKit/WebViewController.mm
@@ -766,6 +766,7 @@ float CYScrollViewDecelerationRateNormal;
[preferences _setLayoutInterval:0];
[preferences setCacheModel:WebCacheModelDocumentBrowser];
+ [preferences setJavaScriptCanOpenWindowsAutomatically:YES];
[preferences setOfflineWebApplicationCacheEnabled:YES];
#if LogMessages
@@ -859,35 +860,10 @@ float CYScrollViewDecelerationRateNormal;
WebView *webview([[webview_ _documentView] webView]);
WebFrame *frame([webview mainFrame]);
- WebPreferences *preferences([webview preferences]);
- bool maybe([preferences javaScriptCanOpenWindowsAutomatically]);
- [preferences setJavaScriptCanOpenWindowsAutomatically:NO];
-
- /*id _private(MSHookIvar<id>(webview, "_private"));
- WebCore::Page *page(_private == nil ? NULL : MSHookIvar<WebCore::Page *>(_private, "page"));
- WebCore::Settings *settings(page == NULL ? NULL : page->settings());
-
- bool no;
- if (settings == NULL)
- no = 0;
- else {
- no = settings->JavaScriptCanOpenWindowsAutomatically();
- settings->setJavaScriptCanOpenWindowsAutomatically(true);
- }*/
-
- if (UIWindow *window = [[self view] window])
- if (UIResponder *responder = [window firstResponder])
- [responder resignFirstResponder];
-
- JSObjectRef object([function JSObject]);
JSGlobalContextRef context([frame globalContext]);
+ JSObjectRef object([function JSObject]);
JSObjectCallAsFunction(context, object, NULL, 0, NULL, NULL);
-
- /*if (settings != NULL)
- settings->setJavaScriptCanOpenWindowsAutomatically(no);*/
-
- [preferences setJavaScriptCanOpenWindowsAutomatically:maybe];
}
- (void) reloadButtonClicked {