This is a migrated thread and some comments may be shown as answers.

Close ChildBrowser When Done With It?

1 Answer 34 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brad
Top achievements
Rank 1
Brad asked on 24 Dec 2012, 12:53 PM
I show the childBrowser using this code:
     window.plugins.childBrowser.showWebPage('http://mywebaddress/myPage.html', { showLocationBar: false });

Is there anything I can put on the page inside that childBrowser control to allow it to close itself and return to the starting page?

Thanks

1 Answer, 1 is accepted

Sort by
0
Brad
Top achievements
Rank 1
answered on 24 Dec 2012, 01:20 PM
I figured this out, but thought the solution could help others.  Poll the childBrowser for my exit url.  If found, close the window.  Works great!

window.plugins.childBrowser.onLocationChange = function(loc){ if (loc.indexOf("exit.htm") >= 0) { window.plugins.childBrowser.close(); }}   

window.plugins.childBrowser.showWebPage('http://' + server, { showLocationBar: false });
Tags
Apache Cordova
Asked by
Brad
Top achievements
Rank 1
Answers by
Brad
Top achievements
Rank 1
Share this question
or