Skip to content

Conversation

@Nifdee
Copy link

@Nifdee Nifdee commented Jan 31, 2025

Similar to #554, we want to remove those event listeners after they've been used.

@google-cla
Copy link

google-cla bot commented Jan 31, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

} else {
handle = rIC(cb);
onHidden(cb);
onHidden(cb, { once: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: This may not work because the once parameter does not take into account if the visibility state was hidden, preventing the callback from being invoked.

if (document.visibilityState === 'hidden') {
      cb();
}

@tunetheweb
Copy link
Member

Thanks for the PR.

However chunks of this have been rewritten in the v5 branch and I don't think this applies anymore. In particular thanks to #541.

@tunetheweb tunetheweb closed this Mar 21, 2025
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

Successfully merging this pull request may close these issues.

3 participants