lbod opened a new issue #889:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/889
<!--
Please have a look at the issue templates you get when you click "New issue"
in the GitHub UI.
We very much prefer issues created by using one of these templates.
-->
### Issue Type
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [ ] Bug Report
- [ ] Feature Request
- [x] Support Question
## Description
We have a site opened in an inappbrowser and that site relies on detecting
if the "cordova_iab" object is present to set up specific setup logic e.g. `if
(cordova) { // do event handler code specific to cordova } else {// do event
handler code for normal browser }`.
The issue we are facing is there appears to be a race condition of some
sort, where sometimes the `cordova_iab` object isn't available yet at page load
time (or when the opened site's JavaScript is initialising).
I am trying to debug the plugin to understand during the lifecycle when that
object is made available to the opened page. However I don't have much
knowledge of Android and Cordova so wanted to ask here, or if there is a better
way to do this?
I have thought it may be better to pass in as a flag (that this is Cordova)
via a request parameter to get round the issue. Knowing if there are possible
race conditions would help me understand if that is a last resort.
## Information
Debugging the pluging I can see when
`inAppWebView.addJavascriptInterface(new JsObject(), "cordova_iab");` but I
have no idea how this relates to the Android Webview lifecycle and indeed, that
of the opened page.
### Command or Code
<!-- What command or code is needed to reproduce the problem? -->
### Environment, Platform, Device
<!-- In what environment, on what platform or on which device are you
experiencing the issue? -->
### Version information
<!--
What are relevant versions you are using?
For example:
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
Other Frameworks: Ionic Framework and CLI version
Operating System, Android Studio, Xcode etc.
-->
```
Ionic:
Ionic CLI : 6.15.0
Ionic Framework : @ionic/angular 5.5.2
@angular-devkit/build-angular : 0.1100.6
@angular-devkit/schematics : 11.0.6
@angular/cli : 11.0.6
@ionic/angular-toolkit : 3.0.0
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : android 9.0.0, ios 6.2.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0,
cordova-plugin-ionic-webview 5.0.0, (and 32 other plugins)
Utility:
cordova-res : 0.15.3
native-run (update available: 1.4.0) : 1.3.0
System:
ios-deploy : 1.11.4
ios-sim : 8.0.2
NodeJS : v14.17.0
npm : 6.14.13
```
## Checklist
<!-- Please check the boxes by putting an `x` in the `[ ]` like so: `[x]` -->
- [x] I searched for already existing GitHub issues about this
- [x] I updated all Cordova tooling to their 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]