Skip to content

Instantly share code, notes, and snippets.

Created Jan 31, 2012
What would you like to do?
PhoneGap new browser window fix
* Start Loading Request
* This is where most of the magic happens... We take the request(s) and process the response.
* From here we can re direct links and other protocalls to different internal methods.
- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
//super hackish hack of the night, so the social networking stuff doesn't trigger another window to be opened.
NSArray *special = [NSArray arrayWithObjects:
NSString *urlStr = [[request URL] absoluteString];
for (NSString * str in special) {
if ([urlStr hasPrefix:str]) {
return YES;
//NSLog(@" allowed URL %@", urlStr);
return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment