MateiNenciu opened a new issue #774:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/774
# Bug Report
## Problem
I have one instance of cordova InAppBrowser and 2 separate opening settings
situations.
Situation A: Open InAppBrowser with settings1.
Situation B: Open InAppBrowser with settings2 ( settings2 = settings1 +
'beforeload=yes' )
### What is expected to happen?
Do Situation B first, open the inAppBrowser, call the beforeload callback
then load the url.
Do Situation A second, no beforeload setting found, load the url
### What does actually happen?
Open InAppBrowser with situation B, close it, setting the instance to
undefined, then open InAppBrowser with situation A but the link does not load (
situation A doesn't have the beforeload=yes )
## Information
<!-- Include all relevant information that might help understand and
reproduce the problem -->
### Command or Code
<!-- What command or code is needed to reproduce the problem? -->
```
let inAppRef
// this should be needed just for situation B
function beforeLoadCallback(params, callback) {
callback(params.url)
}
function exitCallback() {
inAppRef.removeEventListener('beforeload', exitCallback)
inAppRef.removeEventListener('exit', exitCallback)
inAppRef = undefined
}
function situationA() {
inAppRef = window.Cordova.open('someLink', '_blank',
'location=no,toolbar=no,zoom=no,hardwareback=no,usewkwebview=yes')
inAppRef.addEventListener('exit', exitCallback)
}
function situationB() {
inAppRef = window.Cordova.open('someLink', '_blank',
'location=no,toolbar=no,zoom=no,hardwareback=no,usewkwebview=yes,beforeload=yes')
inAppRef.addEventListener('beforeload', beforeLoadCallback)
inAppRef.addEventListener('exit', exitCallback)
}
// in some other place
situationB() // do some magic in browser => then exit
situationA() // browser hangs and don't load url
```
### Environment, Platform, Device
<!-- In what environment, on what platform or on which device are you
experiencing the issue? -->
Android 7.1.4 (emulator)
Android 10 (OnePlus 7T)
### Version information
<!--
What are relevant versions you are using?
For example:
Cordova: 10.0.0
Cordova InAppBrowser: 4.0.0
Cordova Android: 9.0.0
Cordova Browser: 6.0.0
-->
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [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 ( if any more details
needed I will add for every question )
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]