diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-05 03:54:19 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-07 02:41:37 -0800 |
commit | d323285e7d6f4836a189d9419b716b7dbc8c2da6 (patch) | |
tree | 4f51eaf53ddb0bfc4c744d101c275c414f0e0285 /CyteKit/WebViewController.mm | |
parent | 9dbfe708245db7d2dd2c8e779efb413ef0c3f8d3 (diff) |
Disallow serializing ignored URLs to the state.
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); |