You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(browser): Reduce number of visibilitystate and pagehide listeners #18584
Previously, we called onHidden in our slightly modified version of the vendored in whenIdleOrHidden API from web-vitals. This caused 2 additional event listeners to be registered with each whenIdleOrHidden invocation, which also didn't get cleaned up properly.
To fix this, and prevent similar situations, this PR:
inlines the pagehide event listener registration in whenIdleOrHidden so that we can remove the onHidden call
adds once: true to the listener registration so that the callback is only invoked once
deprecates onHidden because IMHO we should remove it in v11 and replace the one remaining use of it with a direct visibilityChange subscription.
Activity
linear commentedon Dec 19, 2025
JS-1341
fix(browser): Reduce number of `visibilitystate` and `pagehide` liste…
github-actions commentedon Jan 12, 2026
A PR closing this issue has just been released 🚀
This issue was referenced by PR #18581, which was included in the 10.33.0 release.