ChildBrowser has been integrated into the core Cordova API in the form of the InAppBrowser API, so we will be removing support for the ChildBrowser plugin sometime in the upcoming weeks.
If anyone is still using it, please migrate your code to InAppBrowser. If you are still using the ChildBrowser plugin because you had problems with the InAppBrowser API, let us know, and we'll try to sort it out.
If anyone is still using it, please migrate your code to InAppBrowser. If you are still using the ChildBrowser plugin because you had problems with the InAppBrowser API, let us know, and we'll try to sort it out.
ryan, Developer
- 1538 Posts
- 132 Reply Likes
Posted 7 years ago
ryan, Developer
- 1538 Posts
- 132 Reply Likes
Usage:
<!-- Open in InAppBrowser -->
<p><a href="#" onclick="window.open('http://www.nhl.com', '_blank', 'location=yes');">_blank</a></p>
<!-- Open in Mobile Safari -->
<p><a href="#" onclick="window.open('http://www.nhl.com', '_system', 'location=yes');">_system</a></p>
<!-- Open in Same Webview -->
<p><a href="#" onclick="window.open('http://www.nhl.com', '_self', 'location=yes');">_self</a></p>
- 8261 Posts
- 263 Reply Likes
- 11 Posts
- 0 Reply Likes
I copied the example for opening in Mobile Safari:
<a href="#" onclick="window.open('https://mywebsite.com.....', '_system', 'location=yes');">
It still opens inside the PhoneGap app - Safari is not launched.
Testing with PhoneGap 2.7.0 AppId 316997
<a href="#" onclick="window.open('https://mywebsite.com.....', '_system', 'location=yes');">
It still opens inside the PhoneGap app - Safari is not launched.
Testing with PhoneGap 2.7.0 AppId 316997
- 11 Posts
- 0 Reply Likes
Well - it turns out this DOES work - PhoneGap Build had got stuck and was not updating my .ipa file, so I was merrily making changes, but looking at a build from last week!
Thanks for your help wildabeast !
Thanks for your help wildabeast !
- 32 Posts
- 2 Reply Likes
Ryan,
I just switched over to inappbrowser -- I was using childbrowser for oAuth situations and I can't get inappbrowser to work properly now. The issue is that the end of the oAuth sequence redirects to local host.
Childbrowser allowed me to grab the oauth code from the url and close the window right away.
I'm having 0 problems on android, but on iOS i get a "load error" displayed before loading the local host page and then I can't grab the code from the url string and authorize the app.
Any thoughts or suggestions?
I just switched over to inappbrowser -- I was using childbrowser for oAuth situations and I can't get inappbrowser to work properly now. The issue is that the end of the oAuth sequence redirects to local host.
Childbrowser allowed me to grab the oauth code from the url and close the window right away.
I'm having 0 problems on android, but on iOS i get a "load error" displayed before loading the local host page and then I can't grab the code from the url string and authorize the app.
Any thoughts or suggestions?
ryan, Developer
- 1538 Posts
- 132 Reply Likes
- 32 Posts
- 2 Reply Likes
I have not whitelisted the auth domains, I didn't realize I had to do that -- but the domain I'm getting a load error on is http://localhost/, not having any issues with any of the google pages. I will try that now though
My app id is 372679
My app id is 372679
- 32 Posts
- 2 Reply Likes
- 34 Posts
- 1 Reply Like
I'm using the 'onLocationChange' event in ChildBrowser. There doesn't seem to be a counterpart in InAppBrowser.
Can someone confirm that there's an event action similar to 'onLocationChange' in InAppBrowser? Am I supposed to attach to 'loadstop' and manually check that the URL is different? Is there sample code out there for this? Thanks.
Can someone confirm that there's an event action similar to 'onLocationChange' in InAppBrowser? Am I supposed to attach to 'loadstop' and manually check that the URL is different? Is there sample code out there for this? Thanks.
ryan, Developer
- 1538 Posts
- 132 Reply Likes
FYI since it appears that there are certiain functions of ChildBrowser not available in InAppBrowser, we will be continuing to support ChildBrowser for the time being.
- 34 Posts
- 1 Reply Like
This doesn't appear to be the case as of this evening.
- 5 Posts
- 0 Reply Likes
I am currently using PhoneGap 2.7.0 and android 4.1.2. I am trying to get a link to open with a native browser such as com.android.browser but it is not working. I have already tried using window.open('http://www.google.com', '_system'); but it did not work and I also tried window.open('http://apache.org', '_blank', 'location=yes');
and it did not work. I have looked through other questions answered but none helped me. Please help this is urgent, any help appreciated!
This reply was created from a merged topic originally titled
Open url with native browser not working!.
and it did not work. I have looked through other questions answered but none helped me. Please help this is urgent, any help appreciated!
This reply was created from a merged topic originally titled
Open url with native browser not working!.
ryan, Developer
- 1538 Posts
- 132 Reply Likes
John are you including phonegap.js (or cordova.js)?
<script src="phonegap.js"></script>- 30 Posts
- 0 Reply Likes
We've looked at switching to the InAppBrowser with each new PhoneGap release, but always run into issues.
1) Page display is different - InAppBrowser usually doesn't size a full/normal website appropriately on iOS (by zooming out) even with the viewportscale turned on. ChildBrowser almost always does.
2) Simple forms don't always work. I believe if you add target="_blank" to a form it won't submit in the InAppBrowser. No issues in ChildBrowser.
Right now now anything I need to open externally is fine via "_system" with the InAppBrowser but anything that requires the browser overlay is still heavily dependent on ChildBrowser.
As we continue to run into these issues, is there somewhere else that bugs/issues with the InAppBrowser should be tracked? Another forum or just new topics in this one?
1) Page display is different - InAppBrowser usually doesn't size a full/normal website appropriately on iOS (by zooming out) even with the viewportscale turned on. ChildBrowser almost always does.
2) Simple forms don't always work. I believe if you add target="_blank" to a form it won't submit in the InAppBrowser. No issues in ChildBrowser.
Right now now anything I need to open externally is fine via "_system" with the InAppBrowser but anything that requires the browser overlay is still heavily dependent on ChildBrowser.
As we continue to run into these issues, is there somewhere else that bugs/issues with the InAppBrowser should be tracked? Another forum or just new topics in this one?
ryan, Developer
- 1538 Posts
- 132 Reply Likes
Issues / bugs with the core PhoneGap API should be discussed in the PhoneGap Google Group, and issues could potentially be logged in the issue tracker at https://issues.apache.org/jira/browse/CB.
- 3 Posts
- 0 Reply Likes
This reply was created from a merged topic originally titled
Opening url in native browser IOS.
Hi Phonegap team. I have an app, running for over 1.5 years.
Appid: 214124.
And it has been working fine until the latest update.
Before this line used to work for opening the native browser:window.open(url, '_blank'); this doesnt work anymore.
I have tried all these combination found in this tread:https://github.com/phonegap/build/iss...
And it still doenst work.
Can someone please help me with opening a url in the native browser outside the app.
/Morten
Opening url in native browser IOS.
Hi Phonegap team. I have an app, running for over 1.5 years.
Appid: 214124.
And it has been working fine until the latest update.
Before this line used to work for opening the native browser:window.open(url, '_blank'); this doesnt work anymore.
I have tried all these combination found in this tread:https://github.com/phonegap/build/iss...
And it still doenst work.
Can someone please help me with opening a url in the native browser outside the app.
/Morten
- 8261 Posts
- 263 Reply Likes
As per Ryan:
<!-- Open in Mobile Safari -->
<p><a href="#" onclick="window.open('http://www.nhl.com', '_system', 'location=yes');">_system</a></p>ryan, Developer
- 1538 Posts
- 132 Reply Likes
You need to include cordova.js / phonegap.js (either or) in your index.html for this to work.
- 2 Posts
- 0 Reply Likes
Hi,
I have a similar question. Our index.html is just redirecting to our mobile website. Is it possible in our mobile site to use phonegap.js somehow, because we want to use _system to open some links in the default OS browser not in the WebView?
We've tried target="_blank" and different access settings in the config.xml but didn't work.
Thank you.
I have a similar question. Our index.html is just redirecting to our mobile website. Is it possible in our mobile site to use phonegap.js somehow, because we want to use _system to open some links in the default OS browser not in the WebView?
We've tried target="_blank" and different access settings in the config.xml but didn't work.
Thank you.
ryan, Developer
- 1538 Posts
- 132 Reply Likes
You should be able to do this. I'm not 100% sure if you can include the local phonegap.js file from your remote app -- you may have to obtain a copy of phonegap.js and add it to your server.
However note that you'll need to include a different copy of phonegap.js for each platform you're running on -- for example:
iOS: https://github.com/apache/cordova-ios...
Android: https://github.com/apache/cordova-and...
So you'll need to do some user-agent detection and include the appropriate version.
Do some searching in this forum, and on the PhoneGap Google Group and everywhere else -- you should be able to find people who've done this.
However note that you'll need to include a different copy of phonegap.js for each platform you're running on -- for example:
iOS: https://github.com/apache/cordova-ios...
Android: https://github.com/apache/cordova-and...
So you'll need to do some user-agent detection and include the appropriate version.
Do some searching in this forum, and on the PhoneGap Google Group and everywhere else -- you should be able to find people who've done this.
- 34 Posts
- 1 Reply Like
Based on this thread the Phonegap Build staff said they're going to hold off on deprecating ChildBrowser, now I'm getting this when I try to build:
"plugin unsupported: ChildBrowser"
"plugin unsupported: ChildBrowser"
ryan, Developer
- 1538 Posts
- 132 Reply Likes
We recently updated our plugins infrastructure -- see our blog post here:
http://phonegap.com/blog/2013/07/15/u...
ChildBrowser isn't listed there, as we are still trying to encourage use of InAppBrowser over it. However it is still supported. Please see
http://build.phonegap.com/plugins and
http://build.phonegap.com/plugins/2
And use
Sorry if this could've been communicated better - will work on it.
http://phonegap.com/blog/2013/07/15/u...
ChildBrowser isn't listed there, as we are still trying to encourage use of InAppBrowser over it. However it is still supported. Please see
http://build.phonegap.com/plugins and
http://build.phonegap.com/plugins/2
And use
com.phonegap.plugins.childbrowser instead of ChildBrowser in your config.xml.
Sorry if this could've been communicated better - will work on it.
- 4 Posts
- 0 Reply Likes
I get an error plugin unsupported: com.phonegap.plugins.childbrowser...
What should I do in order to make it working... I need to open youtube videos in new window. Up to now I was using
Android: $window.plugins.childBrowser.openExternal('https://www.youtube.com/watch?v='+href);
iOS: $window.plugins.childBrowser.showWebPage('https://www.youtube.com/embed/' + href + '?autoplay=1', { showLocationBar: true, showAddress: false });
How should I do that with InApp - I was trying to open videos in new window but no luck. Please advise.
Thanks
What should I do in order to make it working... I need to open youtube videos in new window. Up to now I was using
Android: $window.plugins.childBrowser.openExternal('https://www.youtube.com/watch?v='+href);
iOS: $window.plugins.childBrowser.showWebPage('https://www.youtube.com/embed/' + href + '?autoplay=1', { showLocationBar: true, showAddress: false });
How should I do that with InApp - I was trying to open videos in new window but no luck. Please advise.
Thanks
- 1206 Posts
- 42 Reply Likes
Hi Tommy,
Take a look at InAppBrowser example, perhaps this will be more flexible to use on phonegap build
https://github.com/amirudin/pgb-inAppBrowser
I will appreciated if you can create a new issue with this subject if this problem persist.
Let me know if there is any other help.
Thanks
Hyginus
Take a look at InAppBrowser example, perhaps this will be more flexible to use on phonegap build
https://github.com/amirudin/pgb-inAppBrowser
I will appreciated if you can create a new issue with this subject if this problem persist.
Let me know if there is any other help.
Thanks
Hyginus
- 44 Posts
- 1 Reply Like
InAppBrowser takes away key features of child browser, specifically the ability to pinch to zoom and the ability to break out of the app browser to go to a full blown version of Safari (iPhone) via the button that was on the bottom right of the child browser. What happened to these features? This seems to me to be a step back rather than forward.
- 44 Posts
- 1 Reply Like
Woops, it turns out it is easy to pinch to zoom if your options include ''EnableViewPortScale=yes''. Example:
window.open(URL, '_blank', 'location=yes,EnableViewPortScale=yes');
This is not listed in the plugin API docs.
Are there other options available?
The missing button to break out of the app browser is still an issue.
window.open(URL, '_blank', 'location=yes,EnableViewPortScale=yes');
This is not listed in the plugin API docs.
Are there other options available?
The missing button to break out of the app browser is still an issue.
- 44 Posts
- 1 Reply Like
Any update on the missing button to break out of the app browser and launch the web page in a full blown copy of Safari, or should I switch back over (again) to child browser?
This conversation is no longer open for comments or replies.
This conversation is no longer open for comments or replies.
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers







ryan, Developer
<script src="phonegap.js"></script>