ray-lothian / Block-Site

A browser extension to block website access using hostname matching
https://add0n.com/block-site.html
Mozilla Public License 2.0
223 stars 40 forks source link

What flavor of Regex is used? #128

Open Soreine opened 7 months ago

Soreine commented 7 months ago

Hi, first of all thank you for this extension!

I have tried blocking all https://www.instagram.com/* except for https://www.instagram.com/direct/* which are the DMs.

Using this regex : ^https*:\/\/www\.instagram\.com\/(?!direct).*$, it seems to work on regex101 , but not with Block Site

Could anyone help me?

chrisgloom commented 7 months ago

I think basic javascript regex but I believe they need to be prefixed with R: for some reason.

Here are two that I have working, one that blocks youtube homepage but not youtube videos or search and one that blocks the reddit homepage and subreddits but not specific threads on a subreddit

image
chrisgloom commented 7 months ago

I have noticed there's code to disable the input box of any incoming rule with *'s, not sure if that's for performance reasons. It seems to work regardless.