]> git.saurik.com Git - cydia.git/commitdiff
Fixing more bugs in window opening.
authorJay Freeman (saurik) <saurik@saurik.com>
Fri, 23 Jan 2009 12:15:00 +0000 (12:15 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 30 Sep 2010 07:09:39 +0000 (07:09 +0000)
UICaboodle/BrowserView.m

index 08165235f01a359593a7aa7f7bf06121e1737643..8c484253c6a5d9bb706c931c6892fea4fdbbc219 100644 (file)
     [book_ pushPage:page];
 }
 
+- (void) _pushPage {
+    if (pushed_)
+        return;
+    [self autorelease];
+    pushed_ = true;
+    [book_ pushPage:self];
+}
+
 - (BOOL) getSpecial:(NSURL *)url {
+#if ForSaurik
+    NSLog(@"getSpecial:%@", url);
+#endif
+
     NSString *href([url absoluteString]);
     NSString *scheme([[url scheme] lowercaseString]);
 
         }
 
         [listener use];
+        /* XXX: maybe only the main frame? */
+        [self _pushPage];
         return;
     }
 #if ForSaurik
     //lprintf("Status:%s\n", [text UTF8String]);
 }
 
-- (void) _pushPage {
-    if (pushed_)
-        return;
-    pushed_ = true;
-    [book_ pushPage:self];
-}
-
 - (void) alertSheet:(UIActionSheet *)sheet buttonClicked:(int)button {
     NSString *context([sheet context]);
 
 }
 
 - (NSURLRequest *) webView:(WebView *)sender resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)source {
-    NSURL *url = [request URL];
-    if ([self getSpecial:url])
-        return nil;
-    [self _pushPage];
     return [self _addHeadersToRequest:request];
 }
 
 #endif
 
     BrowserView *browser = [[[BrowserView alloc] initWithBook:book_] autorelease];
-    [self pushPage:browser];
-    [browser loadRequest:request];
+
+    if (request == nil) {
+        [self setBackButtonTitle:title_];
+        [browser setDelegate:delegate_];
+        [browser retain];
+    } else {
+        [self pushPage:browser];
+        [browser loadRequest:request];
+    }
+
     return [browser webView];
 }