How can I get the cordova InAppBrowser to provide a way for the user to close the browser when using an Android device?

后端 未结 8 450
礼貌的吻别
礼貌的吻别 2020-12-13 04:57

I\'m using the cordova InAppBrowser to display content from an external site in my app. When I open the browser on an iPhone, there are some buttons at the bottom of the InA

相关标签:
8条回答
  • 2020-12-13 05:35

    Adding "location=yes" to the end of your call will place an address bar and DONE button at the top of the window on Android. (It appears at the bottom of the window in iOS). Clicking Done closes the window.

    var ref = window.open('http://apache.org', '_blank', 'location=yes');
    
    0 讨论(0)
  • 2020-12-13 05:40

    Just came across a solution that may help achieve your needs better, and/or help other people.

    In summary, you can create a 'dummy' HTML page, add JavaScript in your App to detect when that page is loaded, and when it is loaded, close the InAppBrowser.

    See here: Phonegap build - Open external page in InAppBrowser or childbrowser with no toolbar and close it?

    0 讨论(0)
提交回复
热议问题