-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Remove *some* event listeners with signal
in the viewer
#17964
Remove *some* event listeners with signal
in the viewer
#17964
Conversation
I thought about that too in the last days thanks to @nicolo-ribaudo's patch. |
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/3bc0875fcf42c8d/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/3bc0875fcf42c8d/output.txt Total script time: 2.92 mins Published |
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/322040ef9afc56e/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/edee3109ca04bf5/output.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me, with passing integration tests and the comment answered/addressed. Overall this looks like a nice simplification; thanks!
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/322040ef9afc56e/output.txt Total script time: 10.44 mins
|
By using the `signal` option when invoking `addEventListener`, see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#signal), we're able to remove an arbitrary number of event listeners with (effectively) a single line of code. Besides getting rid of a bunch of `removeEventListener`-calls, which means shorter code, we no longer need to manually keep track of event-handling functions.
By using the `signal` option when invoking `addEventListener`, see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#signal), we're able to remove an arbitrary number of event listeners with (effectively) a single line of code. Besides getting rid of a bunch of `removeEventListener`-calls, which means shorter code, we no longer need to manually keep track of event-handling functions.
…724 follow-up) Given that [bug 1881974](https://bugzilla.mozilla.org/show_bug.cgi?id=1881974) has been fixed in Firefox 126, the workaround should no longer be necessary in the *built-in* Firefox PDF Viewer.
c60bd6d
to
ff2e0c8
Compare
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/edee3109ca04bf5/output.txt Total script time: 17.39 mins
|
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/f1451c80a8e4d9d/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/f1451c80a8e4d9d/output.txt Total script time: 1.82 mins Published |
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/6f43c3643be1eba/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/3e7a1282063cbd0/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/6f43c3643be1eba/output.txt Total script time: 9.94 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/3e7a1282063cbd0/output.txt Total script time: 21.43 mins
|
By using the
signal
option when invokingaddEventListener
, see MDN, we're able to remove an arbitrary number of event listeners with (effectively) a single line of code.Besides getting rid of a bunch of
removeEventListener
-calls, which means shorter code, we no longer need to manually keep track of event-handling functions.Please note: This can obviously be extended to more code, but I figured that starting somewhat small couldn't hurt.