CodeByZach / pace

Automatically add a progress bar to your site.
https://codebyzach.github.io/pace/
MIT License
15.68k stars 1.9k forks source link

Pace.js keeps loading while on low battery mode #497

Open john-khawaja opened 4 years ago

john-khawaja commented 4 years ago

Hi, the pace.js loader will keep loading while IOS devices are on low battery mode. Any fix?

jdmdigital commented 4 years ago

I've seen this too. What we've used in the past is a timeout function to detect that it's just taking WAY too long.

Example: Pace.on('hide', function() { setTimeout(function () { $('.pace').remove(); }, 2000); });

So, that'll remove Pace if it's taking more than 2 seconds--which we're assuming isn't the case. Instead, someone's iOS device is in power save mode.

It's a workaround, not a fix.

kaleidoscopique commented 3 years ago

Another dirty workaround : you can detect low power mode using this.