[Bug]: listeners added via page.on("request", listener)
can't be removed via page.off("request", listener)
#7572
Labels
page.on("request", listener)
can't be removed via page.off("request", listener)
#7572
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: