Jump to content
Search Community

(Chromium) onComplete callback does not fire when document is not visible

TheDarkSid3r test
Moderator Tag

Go to solution Solved by TheDarkSid3r,

Recommended Posts

I have tested this issue in Chrome, Firefox, and Edge. It only occurs in Chrome and Edge so I assume it is a Chromium issue.

 

I am using ticker.lagSmoothing(0) to help tweens play even when the document is not visible (document.visibilityState is hidden)

This works fine, except for the fact that onComplete (and possibly other callbacks) do not fire in this state.

 

To demonstrate, I have a tween that runs when the document is not visible with an onComplete callback that shows an alert. Normally, an alert would show a little blue dot in the tab icon when not visible, however in Chrome/Edge it is clear that the alert does not fire until the tab is refocused.

I also tried setting the document title as a demonstration. This again worked in Firefox but did not occur in Chrome/Edge until I selected the tab again.

See the Pen GRxKJQV by dorksid3r (@dorksid3r) on CodePen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...