Childbrowser launched by Google Map

59 views
Skip to first unread message

Fuse

unread,
Feb 2, 2011, 1:03:07 PM2/2/11
to phonegap
I have the Childbrowser plugin installed to catch any external links,
but it is also being launched when I open up an instance of a Google
Map. Can this be prevented?

Or, can I stop Childbrowser launching by default on external links and
only launch on those links I specify?

Many thanks

Fuse

unread,
Feb 3, 2011, 8:18:28 AM2/3/11
to phonegap
Not only does the Childbrowser launch with the Google map, it also
launches when phone numbers are clicked on and just shows a blank
screen with 'Loading...' in the status bar. Does anybody know a
workaround for this?

Thanks

Allister

unread,
Feb 3, 2011, 11:10:11 AM2/3/11
to phonegap
I have mine set to launch when the script is called on an onclick on
whatever element - I'd actually love to know how to arrange a global
child broswer on any external link, without having to do it
individually. However, I also get the same problem if I try to launch
the phone dialer.

allister

Fuse

unread,
Feb 3, 2011, 12:55:38 PM2/3/11
to phonegap
I installed the plugin by adding the .h and .m files and the .xib file
to a 'ChildBrowser' folder inside 'Plugins' in Xcode. By default, all
my external links are now hijacked by ChildBrowser. While this is the
functionality I need, I still have the issues I described. I didn't
need to include the .js file and I don't reference the
PhoneGap.exec("ChildBrowserCommand.showWebPage"...... function
anywhere.

notoryious

unread,
Feb 12, 2011, 9:41:03 PM2/12/11
to phonegap
This is exactly what's frustrating me. I don't want this to open when
clicking a phone number link, but I can't figure out how to turn it
off..

Did you ever figure it out?

Daniel

unread,
Feb 15, 2011, 6:58:00 AM2/15/11
to phonegap
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;
Reply all
Reply to author
Forward
0 new messages