FrostCo / AdvancedProfanityFilter

A browser extension to filter profanity from webpages
GNU General Public License v3.0
159 stars 26 forks source link

Error in console after ~30 seconds (on almost all websites) #507

Closed uthbees closed 9 months ago

uthbees commented 1 year ago

:bug: Description

On most websites, I get an error in the console after a delay (which seems to be about 20-40 seconds): image

:twisted_rightwards_arrows: Steps To Reproduce

  1. Go to github.com. (The error seems to appear on almost any website, but apparently not all - for instance, it doesn't show up on google.com.)
  2. Wait for the error to appear.

:computer: Details

:pencil: Additional context

It looks like the "line 1, character 35041" from the error message corresponds to this line here: https://github.com/FrostCo/AdvancedProfanityFilter/blob/bdc7a89710fc150c5dbdb132a73cab1c0a1d8357/src/script/mainBackground.ts#L5

richardfrost commented 1 year ago

Thanks for reporting this issue. I can replicate it in Firefox, so I'll see if I can resolve it. It doesn't seem to be affecting chromium browsers.

richardfrost commented 9 months ago

After quite a bit of investigating I'm not really seeing a way I can fix this. It appears to be a reported issue with Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1643186

I'll keep an eye out and see if anything changes, but for now it appears that it might just be an error in their garbage collection process (which is why it isn't consistent in how fast it appears). I haven't found any feature (either in the browser or the extension), but if you find anything let me know.

uthbees commented 9 months ago

Interesting - that definitely seems to be the issue, especially as triggering garbage collection manually causes the error to appear immediately. I don't fully understand what's going on here, but it looks like it happens when (under certain conditions) an async handler is pending when garbage collection triggers? If so, that seems impossible to work around.

I'll go ahead and close this issue, as it looks like there's nothing to be done here short of trying to fix the bug in Firefox. (Luckily, it's only a minor annoyance.)

richardfrost commented 9 months ago

I agree, it seems (at the least) very related to the garbage collection. It appears that this has been a known issue for a while, so hopefully once they address it the error will just go away.

For the record, it appears to affect for Manifest V2 and V3 in Firefox as well.