Replace the function shouldStartLoadWithRequest with this function in
PhoneGap_yourappnamething_delegate.m.
This will give the user only access to http/s websites, all other
sources are opened with the normal WebView. Allowing the developer to
use tel:/sms:/mail =).
Small note, do not use ChildBrowser.install
- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:
(NSURLRequest *)request navigationType:
(UIWebViewNavigationType)navigationType
{
NSURL *url = [request URL];
if (![[url scheme] hasPrefix:@"http"] || // Google Maps fix @author
Daniel Kloosterman ;)
[[url scheme] isEqualToString:@"gap"] ||
[url isFileURL]
) {
return [ super webView:theWebView
shouldStartLoadWithRequest:request
navigationType:navigationType ];
}
else {
ChildBrowserViewController* childBrowser =
[ [ ChildBrowserViewController alloc ] initWithScale:FALSE ];
[super.viewController presentModalViewController:childBrowser
animated:YES ];
[childBrowser loadURL:[url description]];
[childBrowser release];
return NO;