website-blocker-chrome.ext icon indicating copy to clipboard operation
website-blocker-chrome.ext copied to clipboard

Suggestion: Pseudo-Regular Expressions Providing White-Listing and More!

Open Libervurto opened this issue 9 years ago • 0 comments

I am a fan of the scripting style of the extension and would prefer to see that expanded upon rather than introduce special lists. I think even the new 'days of the week' feature should have been implemented as part of the scripting. e.g.

twitter.com 1000-1259 mon

would block only twitter for a time period on Mondays. Alternatively one could block twitter for the entirety of Monday:

twitter.com mon

Or we could block twitter for the working week:

twitter.com 0900-1700 mon-fri

White-listing could also be done via scripting, by prefixing a domain or partial URL with '!' (commonly used to mean 'not'). For example,

reddit.com !/r/leagueoflegends 0930-2300

To appreciate how this line works it's better to read it right to left: if the time is between 0930-2300, and the URL does not include "!/r/leagueoflegends", and the domain is "reddit.com", then block the page.

we can use the '!' to great effect with other parameters too. Say we only want to allow facebook visits between 1700 and 2200, normally this would require blocking the rest of the day like so

facebook.com 0000-1659,2200-2359

which is a bit messy and not immediately obvious, but utilising '!' the same thing would look like this

facebook.com !1700-2200

One example I would find '!' useful is that after certain time at night I only want .org and .ac.uk sites to be accessible. I don't think this is possible with the extension in its current state but it could be achieved like so:

!(.org|.ac.uk) !0800-2300

See I even used another '!' for the time because it was easier to work out that way.

You could also easily make a white-list like so:

!(reddit.com/r/leagueoflegends/|twitter.com|youtube.com)

but that's ugly, so I would much prefer a multi-line format like this:

!{ reddit.com/r/leagueoflegends/ reddit.com/r/crayons/ reddit.com/r/pie/ reddit.com/r/grapefruit/ } (yeah those were the random words I came up with)

One more symbol I'd like to be introduced is '', which stands for any number of random characters, i.e. "How now brown cow" = "How now * cow" = "Hw now " = "Hw". This would have many uses but a fun one is the ability to block the entire internet with a single character,

*

This joke brings up an important point. If such symbols are implemented then '!' must take precedence over '*', that is to say white-listing must take precedence over blocking. We have to be able to visit github after all!

* !github.com

Libervurto avatar Feb 09 '16 00:02 Libervurto