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 2021/05/03 00:17:34 UTC

[GitHub] [cordova-plugin-inappbrowser] nomaam opened a new issue #871: "loadstop" Never Fires and Therefore executeScript Never Fires

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


   # Bug Report
   
   ## Problem
   
   On some webpages, walmart.ca for example, the loadstop event for the inappbrowser is never fired. I assume that since loadstop fires for most websites that walmart.ca (and others) have some kind of code that is still running in the background so the page never really stops loading, and therefore the executeScript event never fires. 
   
   If I manually call .show on the inappbrowser object, for example after 10 seconds as loadstop never was called, the inappbrowser will show and the page appears to have loaded fine. but the executeScript event never fired as loadstop was never called. I have tried calling executeScript just before I call .show with a timer to bypass the loadstop event and the executeScript code doesn't actually get called. 
   
   It appears that only executeScript will work after loadstop event has been fired. 
   
   But, what is the solution if loadstop is never called as the page keeps loading something in the background, but it is fine to show to the user as the webpage has essentially completed loading and is fully functional. 
   
   `
   inAppBrowserRef.addEventListener("loadstop", loadStopCallBack);
   
   function loadStopCallBack() {
   
   inAppBrowserRef.executeScript( ....  // this works if the page actually stops loading
   }
   
   // a delayed function that is called after 30sec
   function timeWait() {
   
   inAppBrowserRef.executeScript( .... // the page is loaded just fine, but "stop" event isn't fired due to some code on the page so executeScript has never fired
   }
   
   `
   
   ### What is expected to happen?
   
   executeScript is called
   
   if i call .show and the page is completely workable, then i shouldn't have to wait for loadstop event to load my injected code. 
   
   ### What does actually happen?
   
   injected code is never called
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   
   see code example
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   
   see code example
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   
   android, newest version on everything
   
   ### 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.
   -->
   
   newest
   
   
   ## 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
   


-- 
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