Unblock a ruleset for a specified duration after delay countdown #187
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the option to have a ruleset unblocked for a user-selected duration after the delay page finishes counting. The max duration can be selected as a per-ruleset setting as well. This should work in tandem with the normal blocking schedule in the same way that the override does.
Why: This makes it possible to use LeechBlock in a similar manner as the many extensions that have popped up that focus on just delaying page access (DelayWebpage, Delay, Mindful Internet Use and so on). The existing model doesn't work too well for that purpose since either all following page accesses on the domain are allowed indefinitely (too permissive) or only the very first page is allowed (too restrictive). The former option also does not let one use the site in another tab or navigate away from the domain and back which can be frustrating. I have seen at least one other person complain about the lack of this feature (see this Hacker News thread) and I'm sure there are others. I think it's a great addition because LeechBlock has a host of features the other extensions don't have and it runs everywhere.
Possible issues: The only issue I see at the moment is that user preferences would not be preserved with this change. The default behaviour of the delay page is unchanged but what was previously a checkbox is now a combobox, so if a user unchecked the "block only first accessed page" option and they updated to this patch the extension would revert to default behaviour until they go back and change it. Not sure how you would deal with this—I suppose one could migrate the old setting to the new one in the setup code.
Not sure how you feel about this, but that's what the PR is for. Thanks for your work on the extension :).