summaryrefslogtreecommitdiff
path: root/UICaboodle/BrowserView.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-02-24 09:44:27 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-07 02:41:16 -0800
commit8366df5e3dc184d578798c9e5635b11ab3f2e440 (patch)
treed46d0b53375b0b8918d4b5f72cdd1d4c8e577ad6 /UICaboodle/BrowserView.mm
parentc08c89434cf43d4fae69f1d9ad7325ac6a4e768b (diff)
Make the navigation action blocker actually useful.
Diffstat (limited to 'UICaboodle/BrowserView.mm')
-rw-r--r--UICaboodle/BrowserView.mm18
1 files changed, 14 insertions, 4 deletions
diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm
index 29fbde6..cb16f00 100644
--- a/UICaboodle/BrowserView.mm
+++ b/UICaboodle/BrowserView.mm
@@ -637,8 +637,16 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
return true;
}
-- (bool) _allowNavigationAction {
- return true;
+- (bool) allowsNavigationAction {
+ return allowsNavigationAction_;
+}
+
+- (void) setAllowsNavigationAction:(bool)value {
+ allowsNavigationAction_ = value;
+}
+
+- (void) setAllowsNavigationActionByNumber:(NSNumber *)value {
+ [self setAllowsNavigationAction:[value boolValue]];
}
- (void) _didFailWithError:(NSError *)error forFrame:(WebFrame *)frame {
@@ -707,10 +715,12 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
if ([frame parentFrame] == nil) {
if (!error_) {
- if ([self _allowNavigationAction])
+ NSURL *url(request == nil ? nil : [request URL]);
+
+ if (request_ == nil || [self allowsNavigationAction] || [[request_ URL] isEqual:url])
request_ = request;
else {
- if ([request URL] != nil)
+ if (url != nil)
[self pushRequest:request asPop:NO];
[listener ignore];
}