Handle Android Back Button on Phonegap InAppBrowser

后端 未结 9 725
小鲜肉
小鲜肉 2020-12-09 21:41

I would like to disable or override the Android Back button while I am navigating pages on the InAppBrowser. Can I add an event listener that can handle that?

9条回答
  •  無奈伤痛
    2020-12-09 21:46

    According to the documentation the behaviour of the hardware back button can be configured now for the InAppBrowser:

    hardwareback: set to yes to use the hardware back button to navigate backwards through the InAppBrowser's history. If there is no previous page, the InAppBrowser will close. The default value is yes, so you must set it to no if you want the back button to simply close the InAppBrowser.

    Thanks to Kris Erickson.

    So just update your InAppBrowser plugin if the backward navigation is the desired behaviour.

    For more details see: https://github.com/apache/cordova-plugin-inappbrowser/pull/86

提交回复
热议问题