Skip to content

Instantly share code, notes, and snippets.

@cgack
Last active December 11, 2015 02:19
Show Gist options
  • Save cgack/4530044 to your computer and use it in GitHub Desktop.
Save cgack/4530044 to your computer and use it in GitHub Desktop.
Whitelist a URL in PhoneGap
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
if ((navigationType == UIWebViewNavigationTypeLinkClicked) &&
([[[request URL] absoluteString] hasPrefix:@"https://www.google.com"]))
{
[[UIApplication sharedApplication] openURL:request.URL];
return NO;
}
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment