From c6cf66c7b507793449127afb9631b62208b534b1 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 9 Mar 2011 02:50:18 -0800 Subject: Apply custom useragent after loadView. --- CyteKit/WebViewController.mm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'CyteKit/WebViewController.mm') 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]; -- cgit v1.2.3