CodeByZach / pace

Automatically add a progress bar to your site.

Home Page:https://codebyzach.github.io/pace/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pace.js keeps loading while on low battery mode

john-khawaja opened this issue · comments

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

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.

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