Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New version of Chrome no longer fires 'visibilitychange' coming from background tabs #11

Open
rj-david opened this issue Sep 21, 2019 · 4 comments

Comments

@rj-david
Copy link

Starting Chrome 77 in Android (to follow in other platforms), background tabs are being "frozen" after 5 minutes of inactivity. When that tab becomes active, the event visibilitychange is no longer being fired. Instead, the new event resume is being used.

More details here: https://developers.google.com/web/updates/2018/07/page-lifecycle-api

@mattmcegg
Copy link

@rj-david does that mean this package no longer works?

@tomscholz
Copy link

I think this package stopped working a long time ago #10

@rj-david
Copy link
Author

rj-david commented Dec 5, 2019

@mattmcegg it was working until the new version of chrome (77). It will disconnect but if the tab was inactive for more than 5 minutes, it will not reconnect because a new lifecycle method is being called for that case

@jasongrishkoff
Copy link

Wouldn't simply adding these two lines at startup solve it?

document.addEventListener('resume', Meteor.reconnect())
document.addEventListener('freeze', Meteor.disconnect())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants