How to close InAppBrowser itself in Phonegap Application?

后端 未结 3 1536
予麋鹿
予麋鹿 2021-01-17 16:14

I am developing Phonegap application and currently i am using InAppBrowser to display external pages. On some of the external pages I place a close

3条回答
  •  借酒劲吻你
    2021-01-17 16:44

    There's a solution provided in this blog post: cross window communication with cordova's inappbrowser

    Essentially, you could use executeScript() from the parent window to the InAppBrowser instance over and over (once or twice a second, for example), to check whether a value in the IAB has been set. Pressing the "close" button in IAB could set such a variable.

    When the parent window discovers that the variable has been set in the IAB, the parent window uses the IAB reference to close() it.

提交回复
热议问题