]> git.saurik.com Git - cydia.git/blobdiff - UICaboodle/BrowserView.mm
chpwn got the "blink only for essential packages" logic backwards, and claims to...
[cydia.git] / UICaboodle / BrowserView.mm
index 73f615539260b782ccca8e6ccda846814e9b3378..2c45468d3d953cca84e056834407021529b8b4ea 100644 (file)
@@ -169,6 +169,7 @@ enum CYWebPolicyDecision {
     switch (decision_) {
         case CYWebPolicyDecisionUnknown:
         default:
+            NSLog(@"CYWebPolicyDecisionUnknown");
             return false;
 
         case CYWebPolicyDecisionDownload: [listener_ download]; break;
@@ -210,12 +211,13 @@ enum CYWebPolicyDecision {
 }
 
 /*- (WebView *) webView:(WebView *)view createWebViewWithRequest:(NSURLRequest *)request {
-    NSLog(@"createWebViewWithRequest:%@", request);
-    WebView *created(nil); // XXX
+    id<CYWebViewDelegate> delegate([self delegate]);
+    WebView *created(nil);
+    if (created == nil && [delegate respondsToSelector:@selector(webView:createWebViewWithRequest:)])
+        created = [delegate webView:view createWebViewWithRequest:request];
     if (created == nil && [UIWebView instancesRespondToSelector:@selector(webView:createWebViewWithRequest:)])
-        return [super webView:view createWebViewWithRequest:request];
-    else
-        return created;
+        created = [super webView:view createWebViewWithRequest:request];
+    return created;
 }*/
 
 // webView:decidePolicyForNavigationAction:request:frame:decisionListener: (2.0+) {{{
@@ -246,7 +248,7 @@ static void $UIWebViewWebViewDelegate$webView$decidePolicyForNewWindowAction$req
     [mediator decide];
 }
 // }}}
-// webView:didClearWindowObject:forFrame: (3.2, 4.1+) {{{
+// webView:didClearWindowObject:forFrame: (3.2+) {{{
 static void $UIWebViewWebViewDelegate$webView$didClearWindowObject$forFrame$(UIWebViewWebViewDelegate *self, SEL sel, WebView *view, WebScriptObject *window, WebFrame *frame) {
     UIWebView *uiWebView(MSHookIvar<UIWebView *>(self, "uiWebView"));
     if ([uiWebView respondsToSelector:@selector(webView:didClearWindowObject:forFrame:)])
@@ -288,7 +290,7 @@ static void $UIWebViewWebViewDelegate$webView$didClearWindowObject$forFrame$(UIW
         [super webView:view didFinishLoadForFrame:frame];
 }
 // }}}
-// webView:didReceiveTitle:forFrame: (3.2, 4.1+) {{{
+// webView:didReceiveTitle:forFrame: (3.2+) {{{
 static void $UIWebViewWebViewDelegate$webView$didReceiveTitle$forFrame$(UIWebViewWebViewDelegate *self, SEL sel, WebView *view, NSString *title, WebFrame *frame) {
     UIWebView *uiWebView(MSHookIvar<UIWebView *>(self, "uiWebView"));
     if ([uiWebView respondsToSelector:@selector(webView:didReceiveTitle:forFrame:)])
@@ -312,7 +314,7 @@ static void $UIWebViewWebViewDelegate$webView$didReceiveTitle$forFrame$(UIWebVie
         [super webView:view didStartProvisionalLoadForFrame:frame];
 }
 // }}}
-// webView:resource:willSendRequest:redirectResponse:fromDataSource: (3.2, 4.1+) {{{
+// webView:resource:willSendRequest:redirectResponse:fromDataSource: (3.2+) {{{
 static NSURLRequest *$UIWebViewWebViewDelegate$webView$resource$willSendRequest$redirectResponse$fromDataSource$(UIWebViewWebViewDelegate *self, SEL sel, WebView *view, id identifier, NSURLRequest *request, NSURLResponse *response, WebDataSource *source) {
     UIWebView *uiWebView(MSHookIvar<UIWebView *>(self, "uiWebView"));
     if ([uiWebView respondsToSelector:@selector(webView:resource:willSendRequest:redirectResponse:fromDataSource:)])
@@ -330,7 +332,7 @@ static NSURLRequest *$UIWebViewWebViewDelegate$webView$resource$willSendRequest$
     return request;
 }
 // }}}
-// webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame: (2.2+) {{{
+// webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame: (2.1+) {{{
 - (void) webView:(WebView *)view runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame {
     id<CYWebViewDelegate> delegate([self delegate]);
     if ([UIWebView instancesRespondToSelector:@selector(webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:)])
@@ -339,7 +341,7 @@ static NSURLRequest *$UIWebViewWebViewDelegate$webView$resource$willSendRequest$
             [super webView:view runJavaScriptAlertPanelWithMessage:message initiatedByFrame:frame];
 }
 // }}}
-// webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame: (2.2+) {{{
+// webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame: (2.1+) {{{
 - (BOOL) webView:(WebView *)view runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame {
     id<CYWebViewDelegate> delegate([self delegate]);
     if ([UIWebView instancesRespondToSelector:@selector(webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:)])
@@ -349,7 +351,7 @@ static NSURLRequest *$UIWebViewWebViewDelegate$webView$resource$willSendRequest$
     return NO;
 }
 // }}}
-// webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame: (2.2+) {{{
+// webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame: (2.1+) {{{
 - (NSString *) webView:(WebView *)view runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)text initiatedByFrame:(WebFrame *)frame {
     id<CYWebViewDelegate> delegate([self delegate]);
     if ([UIWebView instancesRespondToSelector:@selector(webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:)])
@@ -359,7 +361,7 @@ static NSURLRequest *$UIWebViewWebViewDelegate$webView$resource$willSendRequest$
     return nil;
 }
 // }}}
-// webViewClose: (3.2, 4.1+) {{{
+// webViewClose: (3.2+) {{{
 static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *self, SEL sel, WebView *view) {
     UIWebView *uiWebView(MSHookIvar<UIWebView *>(self, "uiWebView"));
     if ([uiWebView respondsToSelector:@selector(webViewClose:)])
@@ -458,6 +460,10 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
 }
 
 - (void) loadRequest:(NSURLRequest *)request {
+#if LogBrowser
+    NSLog(@"loadRequest:%@", request);
+#endif
+
     error_ = false;
 
     WebThreadLock();
@@ -713,6 +719,10 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
 }
 
 - (NSURLRequest *) webView:(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;
 }