Add "Count time on allowed sites" option#689
Conversation
16fba66 to
1c31563
Compare
|
@proginosko Hi, just wanted to check if you've had a chance to look at this PR? I have been using this version locally for the past few months, and it's working well for me! Please let me know if you need me to make any changes! |
|
Sorry, I've been super-busy the last few months, with virtually no time to work on LB. This looks great though. Let me do some testing and get back to you. |
|
Absolutely no worries about the delay, I appreciate you taking the time to look at it! I'm happy you think it's great, it really has made a huge difference for me in how much time I spend on YouTube! Let me know if you run into any issues during testing and I'll be happy to help troubleshoot or update the code. |
|
Sorry again for the delay. Can you explain the code added to the |
- Add new checkbox option in full options mode - Count time spent on exception URLs towards block set limits - Exception sites remain accessible but contribute to time limits - Maintains blocking behavior for main sites when limits are reached Co-authored-by: Cursor <cursoragent@cursor.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1c31563 to
8373577
Compare
|
Hi, no worries! And good question. When I first wrote it I had the exception-counting logic spread across both checkTab and updateTimeData, and honestly wasn't fully clear in my own head about which function was doing what, I just made both aware of the option. Going back through it after your question, I realized the actual time-counting is entirely in updateTimeData. The checkTab part isn't needed for counting at all; its only job is to keep the on-page countdown timer visible while you're on an allowed page like youtube.com/watch. Without it the counting still works, but the timer would vanish the moment you opened a /watch video and only reappear on the main site, which felt wrong to me since the time is still being spent. So the new PR splits it cleanly: updateTimeData counts the time, and the (now smaller, commented) checkTab change only shows the timer on exception pages, with the !isAllowedCount guard making sure those pages are still never actually blocked. It's a bit less code than before and hopefully much clearer to follow. |
This PR adds an option so that time spent on exception URLs (sites with
+in the block set) counts toward the set's time limit. Blocking and allowing of sites is unchanged; only what counts toward the limit changes.Use case: The user blocks
[youtube.com](http://youtube.com/)after 30 min but adds the exception+[youtube.com/watch](http://youtube.com/watch)so they can still watch specific YouTube videos. The idea is to allow only videos they deliberately open (e.g. from a Google search or a direct link), not browsing and discovery on YouTube itself. So they get about 30 minutes of YouTube in total, and after that only the main site is blocked; exception URLs like[youtube.com/watch](http://youtube.com/watch)stay allowed.Current behaviour: While on YouTube, the 30-minute timer runs. The user can open and watch videos. While they watch videos on
[youtube.com/watch](http://youtube.com/watch), the 30-minute timer does not run.What the new option changes: When the new setting is enabled, the 30-minute timer also runs on exception URLs such as
+[youtube.com/watch](http://youtube.com/watch). When the 30 minutes are used up, the main site is blocked; exception pages stay accessible and the timer is hidden on them.Changes
Testing