Search code examples
androidcordovainappbrowser

InAppBrowser location bar not showing


I have recently started learning phonegap .I am using InAppBrowser and i am looking for a way to close it after it opens a link .I searched for ways to close it . I learned that location bar has a done button in it .But in my phone the location bar is not getting displayed .What might be the possible reason for this and how to make it get displayed .I am using android phone gap Thank you


Solution

  • you have to add "location=yes" parameter when you open the InAppBrowser.

    var inappwin = window.open("http://google.com", "_blank", "location=yes");
    

    This is add a "Done" button. You can also programmatically close the the InAppBrowser by calling the .close() method:

    inappwin.close() 
    

    You can also change the "Done" text to something else, here is full documentation for InAppBrowser: http://docs.phonegap.com/en/3.3.0/cordova_inappbrowser_inappbrowser.md.html#InAppBrowser