penge / block-site

Chrome/Firefox extension that blocks access to distracting websites to improve your productivity.

Home Page:https://chrome.google.com/webstore/detail/block-site/bjcnpgekponkjpincbcoflgkdomldlnl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request - block subdirectories only

phaseism opened this issue · comments

Appreciate the work you've done. Really like how simple and easy it is.
Any way to block specific subdomains but still allow top domain? i.e. block youtube.com/user/BBC but still allow youtube.com

Thank you! Only domains are blocked at the moment, but this could be extended to block paths like in the example. Let me have a look at it.

commented

That would be indeed a great feature!
In my case I want to block youtube.com but allow music.youtube.com.

commented

I started to experiment with the following:

  1. Have a second textarea that works as an Allowlist
  2. Allow the user to input RegEx to match against the pathname and hostname

I think a combination of both is required to cover all needs and not break users current blocklist.

What do you think is the best approach for this?

I would try to keep in inside a single textarea, where whitelisted (exceptions to the rule) would start with !.
Example:

youtube.com
!music.youtube.com

Meaning, block youtube.com, but allow music.youtube.com.
What do you think?

commented

The reason behind introducing a second textarea was that it might be more intuitive for non-tech-savvy users.

But agreed, this is the simplest solution for this problem that can be implemented rather quick. I will implement a solution for this and create a pull request.

Souds great @lumoe, thank you.