diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-09 02:50:18 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-09 02:50:18 -0800 |
commit | c6cf66c7b507793449127afb9631b62208b534b1 (patch) | |
tree | 79e3de9c100eea4ffb9679c100925ce3d8eb4181 /MobileCydia.mm | |
parent | 47a40da6459dce3620f5ec132e87ef06925db3b4 (diff) |
Apply custom useragent after loadView.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r-- | MobileCydia.mm | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 11127ac..3d92930 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4279,22 +4279,22 @@ static _H<NSMutableSet> Diversions_; [cydia_ setDelegate:delegate]; } -- (id) init { - if ((self = [super initWithWidth:0 ofClass:[CydiaWebViewController class]]) != nil) { - cydia_ = [[[CydiaObject alloc] initWithDelegate:indirect_] autorelease]; - - WebView *webview([[webview_ _documentView] webView]); +- (NSString *) applicationNameForUserAgent { + NSString *application([NSString stringWithFormat:@"Cydia/%@", @ Cydia_]); - NSString *application([NSString stringWithFormat:@"Cydia/%@", @ Cydia_]); + if (Safari_ != nil) + application = [NSString stringWithFormat:@"Safari/%@ %@", Safari_, application]; + if (Build_ != nil) + application = [NSString stringWithFormat:@"Mobile/%@ %@", Build_, application]; + if (Product_ != nil) + application = [NSString stringWithFormat:@"Version/%@ %@", Product_, application]; - if (Safari_ != nil) - application = [NSString stringWithFormat:@"Safari/%@ %@", Safari_, application]; - if (Build_ != nil) - application = [NSString stringWithFormat:@"Mobile/%@ %@", Build_, application]; - if (Product_ != nil) - application = [NSString stringWithFormat:@"Version/%@ %@", Product_, application]; + return application; +} - [webview setApplicationNameForUserAgent:application]; +- (id) init { + if ((self = [super initWithWidth:0 ofClass:[CydiaWebViewController class]]) != nil) { + cydia_ = [[[CydiaObject alloc] initWithDelegate:indirect_] autorelease]; } return self; } |