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

Race condition when opening blacklisted page in background tab #10

Open
q-- opened this issue Jul 1, 2016 · 1 comment
Open

Race condition when opening blacklisted page in background tab #10

q-- opened this issue Jul 1, 2016 · 1 comment

Comments

@q--
Copy link

q-- commented Jul 1, 2016

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.
@q--
Copy link
Author

q-- commented Aug 27, 2016

I just tested and it works using the Reload current page / Stop loading this page button as well, in the following way:

  • Execute step 1-3 above
  • Move the mouse over the Reload current page / Stop loading this page button ( / ×)
  • Ctrl+ Tab
  • Click the × button.

The loophole is more effective on slower systems.

So, looks like I should write a fix for that as well…

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant