summaryrefslogtreecommitdiff
path: root/CyteKit/WebViewController.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-14 03:54:15 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-14 05:09:11 -0700
commit5bb0da03cad6a6a7608aa0e97297a54c751f8abf (patch)
treee4936f3e8bbf57b91013c44314429cd14644cb82 /CyteKit/WebViewController.mm
parentb3be8c0c05ea03ae25d0128eabc24ee1d160c4c6 (diff)
Seriously solve the auto-redirect issue.
Diffstat (limited to 'CyteKit/WebViewController.mm')
-rw-r--r--CyteKit/WebViewController.mm14
1 files changed, 2 insertions, 12 deletions
diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm
index 40cd6d1..d347a39 100644
--- a/CyteKit/WebViewController.mm
+++ b/CyteKit/WebViewController.mm
@@ -354,9 +354,7 @@ float CYScrollViewDecelerationRateNormal;
return;
if ([[error domain] isEqualToString:WebKitErrorDomain] && [error code] == WebKitErrorFrameLoadInterruptedByPolicyChange) {
- request_ = stage2_;
- stage1_ = nil;
- stage2_ = nil;
+ request_ = nil;
return;
}
@@ -441,10 +439,8 @@ float CYScrollViewDecelerationRateNormal;
- (void) webView:(WebView *)view didDecidePolicy:(CYWebPolicyDecision)decision forNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame {
if ([frame parentFrame] == nil)
if (decision == CYWebPolicyDecisionUse)
- if (!error_) {
- stage1_ = request_;
+ if (!error_)
request_ = request;
- }
}
- (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)frame decisionListener:(id<WebPolicyDecisionListener>)listener {
@@ -502,9 +498,6 @@ float CYScrollViewDecelerationRateNormal;
[loading_ removeObject:[NSValue valueWithNonretainedObject:frame]];
if ([frame parentFrame] == nil) {
- stage1_ = nil;
- stage2_ = nil;
-
if (DOMDocument *document = [frame DOMDocument])
if (DOMNodeList<NSFastEnumeration> *bodies = [document getElementsByTagName:@"body"])
for (DOMHTMLBodyElement *body in (id) bodies) {
@@ -565,9 +558,6 @@ float CYScrollViewDecelerationRateNormal;
allowsNavigationAction_ = true;
- stage2_ = stage1_;
- stage1_ = nil;
-
[self setHidesNavigationBar:NO];
// XXX: do we still need to do this?