sdasda7777 / ScheduleBlock

Browser extension that allows you to block any set of websites based on a schedule.
GNU General Public License v3.0
13 stars 1 forks source link

Feature request: Block site without writing a regex #7

Open Nakrar opened 2 months ago

Nakrar commented 2 months ago

Hi! I would like to make a feature request.

I like the flexibility that regex offers, but personally I use site-wide block more often, then a partial block.

It would be great if it would be possible to copy-paste an URL to the extension and the extension would automatically create a site-wide block for me.

E.g. if I paste https://github.com/sdasda7777/ScheduleBlock/issues/new and click a button, the extension would create a new rule to block all of the github.com.

p.s. Often I would mistakenly close settings modal window by releasing my mouse button while cursor is out of the modal window. Personally I would prefer only click outside of the window to close to.

sdasda7777 commented 2 months ago

Hi, thanks for your interest. There is at least one gotcha to this, in that .*github\.com.* would block even completely different site, such as nogithub.community, but .*\.github\.com/.* might not match a site that does not use a subdomain (as is the case with github.com). I'll try to think this through.

sdasda7777 commented 2 weeks ago

p.s. Often I would mistakenly close settings modal window by releasing my mouse button while cursor is out of the modal window. Personally I would prefer only click outside of the window to close to.

Reworked/removed this feature. Clicking outside modal now flashes buttons that may be used to close it.

sdasda7777 commented 2 weeks ago

Hi, thanks for your interest. There is at least one gotcha to this, in that .github.com. would block even completely different site, such as nogithub.community, but ..github.com/. might not match a site that does not use a subdomain (as is the case with github.com). I'll try to think this through.

So I think https://github.com/sdasda7777/ScheduleBlock/issues/new should result in something like ^(https?://|.*\.)github\.com(/.*)?$? Am I missing something?

Actually, I'm still not completely sure how subdomains should work. I think one might expect blocking www.domain.com would block all subdomains as well, but might not expect blocking any other subdomain to block www.domain.com as well. This shouldn't be hard to do, but it seems a bit finicky to me.

sdasda7777 commented 2 weeks ago

@Nakrar I pushed it to master, if you have any ideas, let me know.