wingman-jr-addon / wingman_jr

This is the official repository (https://github.com/wingman-jr-addon/wingman_jr) for the Wingman Jr. Firefox addon, which filters NSFW images in the browser fully client-side: https://addons.mozilla.org/en-US/firefox/addon/wingman-jr-filter/ Optional DNS-blocking using Cloudflare's 1.1.1.1 for families! Also, check out the blog!
https://wingman-jr.blogspot.com/
Other
35 stars 6 forks source link

No check for extraneous hidden tabs #193

Open TheCranky opened 1 year ago

TheCranky commented 1 year ago

When setting Firefox startup behavior to open previous tabs and windows, hidden tabs from wingman's last session remain open, while new ones are generated per session. There is no check on how many processing tabs the add-on creates, leading to excess browser RAM/performance loss if they are allowed to accumulate.

wingman-jr-addon commented 1 year ago

This is interesting. I'll have to take a peek. When I close/open the browser and am debugging the addon, it doesn't automatically reload so I don't encounter this situation much during my normal development. Thanks @TheCranky

wingman-jr-addon commented 1 year ago

I took a look and I can reproduce the issue in the following way:

Now I believe in this case it only activates if you click on the previous tab. @TheCranky When you reload the browser, are both tabs actually loaded unless you click on them? That impacts the severity of the issue: if it doesn't load automatically, I think encountering it may be a somewhat rare case, but if it does load without specific user action then it is definitely going to be chewing up resources quite regularly.

Either way fixing this may be a bit interesting because if one tries to do this during development, the default behavior of Firefox is to load the addon each time with a different ID. That means that it may get a bit interesting "finding" the old processing tab as it won't have a known URL. I'm sure there's some way to do it though...