proginosko / LeechBlockNG-chrome

LeechBlock NG (Next Generation) for Chrome is a simple productivity tool designed to block those time-wasting sites that can suck the life out of your working day. All you need to do is specify which sites to block and when to block them.
https://www.proginosko.com/leechblock/
Mozilla Public License 2.0
72 stars 14 forks source link

Timer runs when computer is asleep #66

Open jinjyoo opened 6 months ago

jinjyoo commented 6 months ago

Hi! I've noticed that when I'm on a tab with a countdown and then I put my computer to sleep, the timer still runs. So I'll e.g. check a filtered site for a bit, then close my laptop, then when I open it up again a couple hours later, I see the timer has hit 0. Basically, the only way to avoid this is to remember to switch to a non-filtered tab before I close my computer, or else the whole timer gets used up when I'm not using my computer at all.

Not sure if this is configurable or just a bug, but I'm on Chrome Linux for reference. Thank you!

proginosko commented 6 months ago

Thanks for the report. This might be a bug with Chrome, rather than LB. If Chrome is not properly reporting that the tab has lost focus when the system is put to sleep, LB will continue counting time. What happens if you minimize the browser before putting the computer to sleep?

jinjyoo commented 6 months ago

Oh I see – yes, when I minimize Chrome, the timer doesn't go down. I just installed LeechBlock on Firefox to test and it doesn't have the issue, so I guess it's just Chrome. That's inconvenient, but I'll hope a Chrome update changes this at some point.

I'll leave the ticket open for a bit in case anyone wants to add something, but otherwise I'll close it by the end of today (feel free to just close it first if that'd be better). Thanks for the quick response!

proginosko commented 6 months ago

Yes, leave the ticket open until the issue is resolved one way or another.

jinjyoo commented 5 months ago

This issue is still happening as of the latest Chrome version, but I also wanted to add that the timer seems to track beyond 0:00. What I mean is that, if I accidentally put the computer to sleep while still on one of the limited sites, the time "spent" on that site still goes up even though the timer stops at 0:00.

This isn't great because when this sleep-tracking issue happens, I'd prefer to bump up my time limit by 30m or something and then lower it the next day, but instead the timer is still immediately 0:00 so I have to raise the time limit by 10+ hours sometimes to end up with any actual time left on the timer. (The other option is starting an override, which I was doing for the past couple weeks, but don't like doing that because that overrides for all my block sets instead of just the one that had the sleep issue, and the override timer counts down even when I'm not using it, so I end up overriding multiple times a day if I just want to check in short bursts a couple times during the day)

I'm assuming instead of checking the timer directly, it's the "time elapsed" that's measured and then subtracted from the timer (and then added to the Statistics page, etc.) which is why this is happening. This isn't a big issue (Chrome is still the main one), just wanted to bring it up in case there's a way to work around this. No worries if not, thank you!