-
Notifications
You must be signed in to change notification settings - Fork 9k
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
[Bug]: listeners added via page.on("request", listener)
can't be removed via page.off("request", listener)
#7572
Labels
Comments
page.on("request", listener)
can't be removed via page.off("request", listener)
having the same problem |
@fruttut Thanks for taking the time to report this issue! |
jschfflr
pushed a commit
that referenced
this issue
Oct 4, 2021
This patch fixes page.off for request event Closes: #7572
This was referenced May 30, 2022
This was referenced May 30, 2022
This was referenced May 30, 2022
This was referenced Jun 13, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug description
Consider this snippet:
This is very confusing in and of itself, but it gets much worse if I need to swap my
request
listener with another one later on:As far as I can see from the
puppeteer
code, it happens because inPage.ts
theEventEmitter
'son()
method is overridden in such a way that, forrequest
events, it creates a new callback and registers that callback as a listener instead of the one passed in the arguments.Steps to reproduce the problem:
Puppeteer version
10.2.0
Node.js version
14.17.6
npm version
6.14.15
What operating system are you seeing the problem on?
Linux
Relevant log output
No response
The text was updated successfully, but these errors were encountered: