So basically, the issue is that onloadend fires, both functions run, but the browser immediately jumps to location.href before prBarTimer(80, 100) has any chance to finish, right?
orbit beats
Since prBarTimer is async and I'm not awaiting it, the redirect happens instantly, and the browser doesn't bother rendering the progress animation because it’s already navigating away.