return @"substitutePackageNames";
else if (selector == @selector(scrollToBottom:))
return @"scrollToBottom";
+ else if (selector == @selector(setAllowsNavigationAction:))
+ return @"setAllowsNavigationAction";
else if (selector == @selector(setButtonImage:withStyle:toFunction:))
return @"setButtonImage";
else if (selector == @selector(setButtonTitle:withStyle:toFunction:))
[indirect_ setButtonTitle:button withStyle:style toFunction:function];
}
+- (void) setAllowsNavigationAction:(NSString *)value {
+ [indirect_ performSelectorOnMainThread:@selector(setAllowsNavigationActionByNumber:) withObject:value waitUntilDone:NO];
+}
+
- (void) setHidesBackButton:(NSString *)value {
[indirect_ performSelectorOnMainThread:@selector(setHidesBackButtonByNumber:) withObject:value waitUntilDone:NO];
}
return [NSURL URLWithString:[NSString stringWithFormat:@"cydia://package/%@", (id) name_]];
}
-- (bool) _allowNavigationAction {
- // XXX: damn it... I really want this.
- return true;
-}
-
/* XXX: this is not safe at all... localization of /fail/ */
- (void) _clickButtonWithName:(NSString *)name {
if ([name isEqualToString:UCLocalize("CLEAR")])
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 {
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];
}