meteor-smart-disconnect icon indicating copy to clipboard operation
meteor-smart-disconnect copied to clipboard

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

Open rj-david opened this issue 5 years ago • 4 comments

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

rj-david avatar Sep 21 '19 08:09 rj-david

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

mattmcegg avatar Dec 05 '19 15:12 mattmcegg

I think this package stopped working a long time ago https://github.com/mixmaxhq/meteor-smart-disconnect/issues/10

tomscholz avatar Dec 05 '19 17:12 tomscholz

@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

rj-david avatar Dec 05 '19 18:12 rj-david

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

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

jasongrishkoff avatar Jan 25 '20 16:01 jasongrishkoff