Added possibility to set multiple options to show instead of blocked … #267
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 possibility to specify many URLs to show instead of blocked pages. Every time when a user goes to a page from the block list - the block page will be shown randomly from the specified list.
Example:
I have a delay for opening YouTube. Now I can add specify multiple options to show instead of blocked pages:
delay page, Duolingo, and two times my task list in notion.
So when I'll go to YouTube, I'll be redirected to the delay page in 25% of cases, to Duolingo in 25% of cases, and to Notion in 50% of cases.
Why:
It's good to see your task list when you are going to go to some distracting page.
I think a better solution will be redirecting somewhere, showing there the delaying timer and showing a button to go to the desired page after finishing the countdown. But it's harder to implement.
Possible issues: The only issue I see is that people who actually have custom URL to redirect, will get the default value in this configuration. This issue is caused because of renaming blockURL to blockURLs. There are no logical issues to keep the old name for blockURL, but the name can be a bit misleading.
What I have changed:
+element blockURL is a multiline textbox now.
+instead of buttons "Default Page", "Delaying Page", and "Blank Page" there are plus and minus buttons for each of these standard options. Plus button adds to blockURLs one line of the standard option. Minus button - removes one line.
+each time when you go to the site from the block list, you will be redirected to randomly selected one of the options from blockURLs list.
If you will have any remarks, or questions to my PR, please let me know. I'll fix it or answer it)