Skip to content
This repository was archived by the owner on Apr 9, 2023. It is now read-only.
This repository was archived by the owner on Apr 9, 2023. It is now read-only.

Race condition when opening blacklisted page in background tab #10

@q--

Description

@q--

Note: this only works if the Firefox option When I open a link in a new tab, switch to it immediately. is disabled (under Preferences > General).

Steps to reproduce:

  1. Go to a blacklisted website that isn't insanely fast at firing DOMContentLoaded, e.g. NYTimes.com.
  2. The LeechBlock "Blocked" page will show up. (I'm using the default page.)
  3. Middle-click the here link to open the blocked page in a new tab.
  4. Move the cursor to the new tab.
  5. Start repeatedly hitting Esc at an insane rate
  6. Wait a second or so for enough of the time-wasting site's content to have loaded, somewhere after the title appears but before LeechBlock kicks in.
  7. Click the new tab. Esc sometimes appears to cancel tab switching, so repeat if necessary.
  8. Stop hitting Esc only after the page loading-spinner disappears.
  9. Waste time.

And, yeah, I really shouldn't be doing this...

I tried looking for an easy solution to this, but apparently there's no "load canceled by user" event like there is a DOMContentLoaded event. Maybe there's something only available to Firefox extensions, I don't know.


By the way, thanks for the amazing extension! It really helps me to be more productive. Bad habits are sometimes hard to overcome, so LeechBlock is a real help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions