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

BeforeRequest autocmds are not cleaned up properly #4921

Open
cmcaine opened this issue Feb 9, 2024 · 0 comments · May be fixed by #4922
Open

BeforeRequest autocmds are not cleaned up properly #4921

cmcaine opened this issue Feb 9, 2024 · 0 comments · May be fixed by #4922

Comments

@cmcaine
Copy link
Member

cmcaine commented Feb 9, 2024

Tridactyl version: 1.24.0pre6973-2414aba4
Firefox version: Mozilla Firefox 122.0.1
Operating system: win

  • Brief description of the problem: Unlike other tridactyl autocommands, if you add multiple autocmds for the same pattern then they will all be run. I expected only the most recent autocmd to run.

  • Steps to reproduce:

    1. :autocmd BeforeRequest https://example.com () => console.log(1)
    2. :autocmd BeforeRequest https://example.com () => console.log(2)
    3. Open the debugging inspector for tridactyl and visit example.com. Observe that both "1" and "2" are logged.

:autocmddelete unregisters only the most recent listener.

  • Possible fixes:

Easiest would be to make src/background/webrequests.ts:registerWebRequestAutocmd unregister any pre-existing autocommand for the given event and pattern.

@cmcaine cmcaine linked a pull request Feb 9, 2024 that will close this issue
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 a pull request may close this issue.

1 participant