You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
Thanks for your help, I have the exact same problem and it looks your first fix works.
Also, I would recommend using innerLocalSplash.remove() instead of document.body.removeChild(innerLocalSplash); to deal with edge cases, e.g. usage in Chrome Extension that might create multiple bodies when you close and open it
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
Just waiting 200 ms before appending the splashscreen, like this
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
Command or Code
Requires a fast computer, and I have seen it on the latest version of Chrome
Environment, Platform, Device
Chrome
Version information
Using cordova-plugin-splashscreen 5.0.3
Checklist
The text was updated successfully, but these errors were encountered: