summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2015-06-24 10:09:30 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2015-06-24 10:09:30 -0700
commit92de61aabba908e254b8d4f1498798043fdabbe7 (patch)
treedc4b65d814403a8fc24e9e84a38018b5047cb45d
parent202bf8406ce550a612cce583115dc6e1f07bb031 (diff)
Now on iOS 8.3, webView: can be webThreadWebView:.
-rw-r--r--CyteKit/WebView.h1
-rw-r--r--CyteKit/WebView.mm10
-rw-r--r--CyteKit/WebViewController.h2
-rw-r--r--CyteKit/WebViewController.mm8
-rw-r--r--MobileCydia.mm4
-rw-r--r--iPhonePrivate.h1
6 files changed, 26 insertions, 0 deletions
diff --git a/CyteKit/WebView.h b/CyteKit/WebView.h
index 804c037..7314da6 100644
--- a/CyteKit/WebView.h
+++ b/CyteKit/WebView.h
@@ -55,6 +55,7 @@ enum CYWebPolicyDecision {
- (void) webView:(WebView *)view resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)source;
- (void) webView:(WebView *)view resource:(id)identifier didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)source;
- (NSURLRequest *) webView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
+- (NSURLRequest *) webThreadWebView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
- (void) webViewClose:(WebView *)view;
- (bool) webView:(WebView *)view shouldRunJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
- (bool) webView:(WebView *)view shouldRunJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
diff --git a/CyteKit/WebView.mm b/CyteKit/WebView.mm
index 6630463..df37711 100644
--- a/CyteKit/WebView.mm
+++ b/CyteKit/WebView.mm
@@ -295,6 +295,16 @@ static NSURLRequest *$UIWebViewWebViewDelegate$webView$resource$willSendRequest$
return request;
}
// }}}
+// webThreadWebView:resource:willSendRequest:redirectResponse:fromDataSource: {{{
+- (NSURLRequest *) webThreadWebView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source {
+ id<CyteWebViewDelegate> delegate([self delegate]);
+ if ([UIWebView instancesRespondToSelector:@selector(webThreadWebView:resource:willSendRequest:redirectResponse:fromDataSource:)])
+ request = [super webThreadWebView:view resource:identifier willSendRequest:request redirectResponse:response fromDataSource:source];
+ if ([delegate respondsToSelector:@selector(webThreadWebView:resource:willSendRequest:redirectResponse:fromDataSource:)])
+ request = [delegate webThreadWebView:view resource:identifier willSendRequest:request redirectResponse:response fromDataSource:source];
+ return request;
+}
+// }}}
// webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame: (2.1+) {{{
- (void) webView:(WebView *)view runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame {
[[self retain] autorelease];
diff --git a/CyteKit/WebViewController.h b/CyteKit/WebViewController.h
index 2483224..8410432 100644
--- a/CyteKit/WebViewController.h
+++ b/CyteKit/WebViewController.h
@@ -107,7 +107,9 @@
- (void) reloadURLWithCache:(BOOL)cache;
- (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame;
+
- (NSURLRequest *) webView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
+- (NSURLRequest *) webThreadWebView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
+ (float) defaultWidth;
diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm
index 33524f3..a7ff586 100644
--- a/CyteKit/WebViewController.mm
+++ b/CyteKit/WebViewController.mm
@@ -711,6 +711,14 @@ float CYScrollViewDecelerationRateNormal;
return request;
}
+- (NSURLRequest *) webThreadWebView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source {
+#if LogBrowser
+ NSLog(@"resource:%@ willSendRequest:%@ redirectResponse:%@ fromDataSource:%@", identifier, request, response, source);
+#endif
+
+ return request;
+}
+
- (bool) webView:(WebView *)view shouldRunJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame {
return [self _allowJavaScriptPanel];
}
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 6dfe632..72950d3 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -4956,6 +4956,10 @@ static _H<NSMutableSet> Diversions_;
return [CydiaWebViewController requestWithHeaders:[super webView:view resource:resource willSendRequest:request redirectResponse:response fromDataSource:source]];
}
+- (NSURLRequest *) webThreadWebView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source {
+ return [CydiaWebViewController requestWithHeaders:[super webThreadWebView:view resource:resource willSendRequest:request redirectResponse:response fromDataSource:source]];
+}
+
+ (NSURLRequest *) requestWithHeaders:(NSURLRequest *)request {
NSMutableURLRequest *copy([[request mutableCopy] autorelease]);
diff --git a/iPhonePrivate.h b/iPhonePrivate.h
index 42a700d..06aff31 100644
--- a/iPhonePrivate.h
+++ b/iPhonePrivate.h
@@ -335,6 +335,7 @@ static const UIActivityIndicatorViewStyle UIActivityIndicatorViewStyleWhiteTiny(
- (void) webView:(WebView *)view resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)source;
- (void) webView:(WebView *)view resource:(id)identifier didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)source;
- (NSURLRequest *) webView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
+- (NSURLRequest *) webThreadWebView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
- (void) webView:(WebView *)view runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
- (BOOL) webView:(WebView *)view runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
- (NSString *) webView:(WebView *)view runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)text initiatedByFrame:(WebFrame *)frame;