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 /CyteKit | |
parent | 47a40da6459dce3620f5ec132e87ef06925db3b4 (diff) |
Apply custom useragent after loadView.
Diffstat (limited to 'CyteKit')
-rw-r--r-- | CyteKit/WebViewController.mm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm index 964e523..76379fb 100644 --- a/CyteKit/WebViewController.mm +++ b/CyteKit/WebViewController.mm @@ -775,6 +775,10 @@ float CYScrollViewDecelerationRateNormal; } return self; } +- (NSString *) applicationNameForUserAgent { + return nil; +} + - (void) loadView { CGRect bounds([[UIScreen mainScreen] applicationFrame]); @@ -812,6 +816,9 @@ float CYScrollViewDecelerationRateNormal; [preferences setJavaScriptCanOpenWindowsAutomatically:YES]; [preferences setOfflineWebApplicationCacheEnabled:YES]; + if (NSString *agent = [self applicationNameForUserAgent]) + [webview setApplicationNameForUserAgent:agent]; + if ([webview respondsToSelector:@selector(setShouldUpdateWhileOffscreen:)]) [webview setShouldUpdateWhileOffscreen:NO]; |