Github user sgrebnov commented on the pull request:

    
https://github.com/apache/cordova-plugin-inappbrowser/pull/145#issuecomment-176320293
  
    setTimeout is required to support the following scenario. On ios, android 
and other platforms functionality creates InAppBrowser on native side, so ln2 
happens before webview is created and events are triggered. As a quick fix on 
Windows I made open method async so that it works (this is what docs recommend 
to use so we should support this). Since I made open async I made async other 
methods so that their functionality is triggered after open.
    ```
    ln1: var ref  = cordova.InAppBrowser.open()
    ln2: ref.addEventListener('startload', function() {..})
    ln3: ref.close()
    ```
    
    PS. Thank you for the setImmediate tip - will update the code


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to