summaryrefslogtreecommitdiff
path: root/CyteKit/WebViewController.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-04 20:52:52 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-07 02:41:36 -0800
commit9dbfe708245db7d2dd2c8e779efb413ef0c3f8d3 (patch)
tree61d32d69655157709ae2de2e084e97cc2c449d28 /CyteKit/WebViewController.mm
parent45e660378a2efdec34832ccc597cd72f7f8c6430 (diff)
Just turn on setJavaScriptCanOpenWindowsAutomatically globally to fix 4.2.
Diffstat (limited to 'CyteKit/WebViewController.mm')
-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 {