AsciiJakob / NoDistractions

Simple, bloat-free website blocker with a focus on intuitiveness
https://addons.mozilla.org/en-US/firefox/addon/nodistractions-website-blocker/
MIT License
3 stars 1 forks source link

On browser startup, if you're fast you can access a site before addon initializes #9

Open tuurep opened 2 months ago

tuurep commented 2 months ago

If addon is supposed to be enabled on startup, it takes something like ~1 second to initialize.

For some people this can be a non-issue, but I habitually launch a browser and immediately go to a site in a way that's always faster than the initialize time.

AsciiJakob commented 2 months ago

I have an idea for a way to fix this and will try it out today if I have the time

AsciiJakob commented 2 months ago

Two issues have now been fixed:

  1. The problem you described
  2. If the last page focused after starting firefox with persistent tabs enabled is in the blocklist it gets blocked.

Fixing this was very hacky. I have to rely on a settimeout in order for my check to compensate for the amount of time it takes for the webrequest listener to get started. But whatever, it works. Perhaps you want to verify that it is fixed?

tuurep commented 2 months ago

Yeah this works great! Was there anything else here or should we close this? :)

AsciiJakob commented 2 months ago

All done. Cheers for submitting the issue

tuurep commented 2 months ago

Reminder: we found out that depending on site, issue may still occur (which is strange)

Doesn't happen with reddit, but still happens with youtube.

Should we reopen this?

AsciiJakob commented 2 months ago

Yep. I'm gonna have to investigate this, fix should be included in the next release but I don't think it's worth making a patch just for this bug