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

Page.once doesn't clean up request interceptors #7495

Closed
HitkoDev opened this issue Aug 11, 2021 · 1 comment
Closed

Page.once doesn't clean up request interceptors #7495

HitkoDev opened this issue Aug 11, 2021 · 1 comment

Comments

@HitkoDev
Copy link

HitkoDev commented Aug 11, 2021

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 10.2.0
  • Platform / OS version: all
  • URLs (if applicable): N/A
  • Node.js version: 16

What steps will reproduce the problem?

Please include code that reproduces the issue.

const interceptor = (request) => console.log(request.url())
page.once("request", interceptor)
page.goto(`http://google.com`)

What is the expected result?

Logs URL of the first request (http://google.com), then removes interceptor.

What happens instead?

Logs all URLs, including subsequent requests (e.g. CSS stylesheets).

@zeen
Copy link

zeen commented Nov 28, 2021

This is likely due to the now fixed #7572 and seems to no longer be happening in 12.0.0.

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

3 participants