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
The visible() function had a memory leak when querySelectorAll returned
no elements - the IntersectionObserver was created but never observed
anything, so the promise never resolved and the observer/closure were
retained forever.
Fix by:
- First checking if elements exist
- If they exist, create IntersectionObserver (original behavior)
- If they don't exist, create MutationObserver to watch for DOM insertions
- When element appears, disconnect MutationObserver and create IntersectionObserver
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments