You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/07/05 19:50:06 UTC

[GitHub] [cordova-plugin-splashscreen] ThorvaldAagaard opened a new issue #226: Rendering to fast?

ThorvaldAagaard opened a new issue #226: Rendering to fast?
URL: https://github.com/apache/cordova-plugin-splashscreen/issues/226
 
 
   # Bug Report
   It looks like the code is executed to fast, when running in a browser, so when the show-function is called, then document.body is still null, thus giving a javascript error
   ## Problem
   No splashscreen
   ### What is expected to happen?
   Splashscreen should be shown in browser
   
   
   ### What does actually happen?
   document.body.appendChild(localSplash); returns exception as document.body is still null
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   
   Just waiting 200 ms before appending the splashscreen, like this
   
               window.setTimeout(function () {
                   if (document.body) {
                       document.body.appendChild(localSplash);
                   }
               }, 200);
   
   seems to fix the problem
   
   Another idea might also be to make the hide more robust by adding a check before removing the child like this
   
               window.setTimeout(function () {
                   console.log("Removing splash: " + innerLocalSplash);
                   if (innerLocalSplash && innerLocalSplash.parentNode == document.body) {
                       document.body.removeChild(innerLocalSplash);
                   }
                   innerLocalSplash = null;
               }, 1000);
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   Requires a fast computer, and I have seen it on the latest version of Chrome
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   Chrome
   
   
   ### 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.
   -->
   Using cordova-plugin-splashscreen 5.0.3
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [X] I searched for existing GitHub issues
   - [ ] I updated all Cordova tooling to most recent version
   - [ ] 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


With regards,
Apache Git Services

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