You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/07/09 18:40:10 UTC

[GitHub] [cordova-plugin-inappbrowser] sagrawal31 opened a new issue #752: Events are not isolated between multiple instances of IAB

sagrawal31 opened a new issue #752:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/752


   # Bug Report
   
   ## Problem
   
   If multiple instances of IAB are created, only the events from the last created IAB instances are called back.
   
   ### What does actually happen?
   
   Consider, we create one InAppBrowser-
   
   ```javascript
   const inAppBrowserRef1 = cordova.InAppBrowser.open('http://example.com', '_blank', 'location=yes');
   
   inAppBrowserRef1.addEventListener('loadstart', loadStartCallBack);
   inAppBrowserRef1.addEventListener('exit', loadExitCallBack);
   inAppBrowserRef1.addEventListener('message', messageCallBack);
   ```
   
   All the callback works fine. Now, while this IAB is open and we launch another IAB with target as `_system`-
   
   ```javascript
   const inAppBrowserRef2 = cordova.InAppBrowser.open('http://google.com', '_system');
   
   inAppBrowserRef2.addEventListener('loadstart', loadStartCallBack);
   inAppBrowserRef2.addEventListener('exit', loadExitCallBack);
   inAppBrowserRef2.addEventListener('message', messageCallBack);
   ```
   
   After this code is executed, all the event listeners on `inAppBrowserRef1` stop working and instead they start to execute on `inAppBrowserRef2` listeners for the first IAB instance.
   
   ### What is expected to happen?
   
   Event callbacks on `inAppBrowserRef1` should work irrespective of other IAB i.e. `inAppBrowserRef2`.
   
   ## Information
   
   Came to know about this problem while implementing message listeners and I was able to listen the `message` events only once as described here https://gist.github.com/sagrawal31/9004198ae56a58ff235ce0f1dd62362c
   
   ### Command or Code
   
   Already shared the code above.
   
   ### Environment, Platform, Device, Version information
   
   - Cordova- 9.0.0 (cordova-lib@9.0.1)
   - cordova-android- 8.1.0 & 9.0.0
   - Android OS- Samsung UI 2.0 (Android 10)
   - Plugin version- ^4.0.0
   - OS- macOS Catalina
   - Tested on a fresh/empty Cordova app
   - Android Studio- 4
   
   ## Checklist
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-inappbrowser] pat-flew commented on issue #752: Events are not isolated between multiple instances of IAB

Posted by GitBox <gi...@apache.org>.
pat-flew commented on issue #752:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/752#issuecomment-744094604


   I had the same issue on Android. Reattaching events to the return value of the `cordova.InAppBrowser.open('http://google.com', '_system')` call seemed to resolve for me at the time. The issue didn't appear to affect iOS.
   
   However having done some further testing in iOS, It appears that following opening a system browser and pressing the top right arrow to go back, the original app browser reference no longer responds to executeScript (script is not executed and callback is never called), and using the updated reference from InAppBrowser.open does not help.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-inappbrowser] brunogc commented on issue #752: Events are not isolated between multiple instances of IAB

Posted by GitBox <gi...@apache.org>.
brunogc commented on issue #752:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/752#issuecomment-794625152


   I am experiencing the same problem.
   
   However, unlike everyone above, reattaching the event does not seem to work for me (Android 10, Cordova 10, InAppBrowser 5).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-inappbrowser] javierjsp commented on issue #752: Events are not isolated between multiple instances of IAB

Posted by GitBox <gi...@apache.org>.
javierjsp commented on issue #752:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/752#issuecomment-783711347


   This is still a Issue Same behaviour on Android and iOS, the events are not isolated between multiple instances.
   
   `InAppBrowser.open('http://example.com', '_blank');`
   &
   `cordova.InAppBrowser.open('http://google.com', '_system')`
   
   Tested on Android 10 and iOS 14.4(iphone XR)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-inappbrowser] pat-flew edited a comment on issue #752: Events are not isolated between multiple instances of IAB

Posted by GitBox <gi...@apache.org>.
pat-flew edited a comment on issue #752:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/752#issuecomment-744094604


   I had the same issue on Android. Reattaching events to the return value of the `cordova.InAppBrowser.open('http://google.com', '_system')` call seemed to resolve for me at the time. The issue didn't appear to affect iOS.
   
   However having done some further testing in iOS, It appears that following opening a system browser and pressing the top left arrow to go back, the original app browser reference no longer responds to executeScript (script is not executed and callback is never called), and using the updated reference from InAppBrowser.open does not help.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-inappbrowser] Delagen commented on issue #752: Events are not isolated between multiple instances of IAB

Posted by GitBox <gi...@apache.org>.
Delagen commented on issue #752:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/752#issuecomment-945604607


   Seems like postmessage in iab stop works after open external url (.open(url,'_system'))


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-inappbrowser] sagrawal31 commented on issue #752: Events are not isolated between multiple instances of IAB

Posted by GitBox <gi...@apache.org>.
sagrawal31 commented on issue #752:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/752#issuecomment-745293824


   Yes, passing `_system` was not an option for me because of the same issue in iOS.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-inappbrowser] Delagen edited a comment on issue #752: Events are not isolated between multiple instances of IAB

Posted by GitBox <gi...@apache.org>.
Delagen edited a comment on issue #752:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/752#issuecomment-945604607


   Experience the same issue, look for plugin that simply open url in external browser


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org