zeroasterisk / MeteorRider

PhoneGap/Cordova + Meteor integration approach "DOM hijacking", telling PhoneGap where to get content from, letting Meteor hijack your PhoneGap app's HTML/CSS/JS
MIT License
183 stars 28 forks source link

Handle gracefully DOM hijacking without blank screen #25

Open mstn opened 10 years ago

mstn commented 10 years ago

The phase between document.open and document.close takes a bit of time and a blank screen is shown for few milliseconds while the new document is loading. I would like to get rid of this white screen.

A rough solution is to use a splashscreen that covers everything until the end of hijacking. However, I'd prefer to show a loading indicator instead of a fixed picture. I googled a bit and it seems that it is possible to have animated native splashscreen in Android, but I'd prefer to not write native code.

Immediately after document.close, document.readyState is 'loading', not 'complete'. I guess document.{close,open} are async. I doubt a loader indicator can be shown while document is loading.

Does anyone have any idea about how to make dom loading as fast as possible?

zeroasterisk commented 10 years ago

Indeed this is something I'm going to be working on. I don't think I can totally resolve it but I can get a chunk of the way there by inlining the JS and CSS assets via localStorage and (injecting on DOM hijack).

if I remember correctly I experimented with only hijacking part of the DOM which would have allowed you to only switch to meteor after it was loaded... But it didn't work for me... feel free to experiment and let me know what you come up with. On Jul 24, 2014 12:49 PM, "Marco" notifications@github.com wrote:

The phase between document.open and document.close takes a bit of time and a blank screen is shown for few milliseconds while the new document is loading. I would like to get rid of this white screen.

A rough solution is to use a splashscreen that covers everything until the end of hijacking. However, I'd prefer to show a loading indicator instead of a fixed picture. I googled a bit and it seems that it is possible to have animated native splashscreen in Android, but I'd prefer to not write native code.

Immediately after document.close, document.readyState is 'loading', not 'complete'. I guess document.{close,open} are async. I doubt a loader indicator can be shown while document is loading.

Does anyone have any idea about how to make dom loading as fast as possible?

— Reply to this email directly or view it on GitHub https://github.com/zeroasterisk/MeteorRider/issues/25.