diff options
Diffstat (limited to 'CyteKit/WebViewController.mm')
-rw-r--r-- | CyteKit/WebViewController.mm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm index 39103fb..e67e6bc 100644 --- a/CyteKit/WebViewController.mm +++ b/CyteKit/WebViewController.mm @@ -411,9 +411,7 @@ float CYScrollViewDecelerationRateNormal; if (!error_) { NSURL *url(request == nil ? nil : [request URL]); - if (request_ == nil || [self allowsNavigationAction] || [[request_ URL] isEqual:url]) - request_ = request; - else { + if (request_ != nil && ![[request_ URL] isEqual:url] && ![self allowsNavigationAction]) { if (url != nil) [self pushRequest:request asPop:NO]; [listener ignore]; @@ -422,6 +420,11 @@ float CYScrollViewDecelerationRateNormal; } } +- (void) webView:(WebView *)view didDecidePolicy:(CYWebPolicyDecision)decision forNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame { + if (decision == CYWebPolicyDecisionUse) + request_ = request; +} + - (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)frame decisionListener:(id<WebPolicyDecisionListener>)listener { #if LogBrowser NSLog(@"decidePolicyForNewWindowAction:%@ request:%@ newFrameName:%@", action, request, frame); |