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

Feature Request: Block all redirect links #109

Open gabrielklein opened 1 year ago

gabrielklein commented 1 year ago

Thank you, it's really great not to be forced to view sexual content anymore on some pages.

User behavior I often have pages that are redirected. PageIWant.com => RedirectIDontWant1.com => RedirectIDontWant2.com => RedirectIDontWant3.com I block RedirectIDontWant3.com

What I want I want to be able to block RedirectIDontWant1.com, RedirectIDontWant2.com, RedirectIDontWant3.com

Details I open the main page: PageIWant.com (wanted) Then it redirect to RedirectIDontWant1.com (not wanted) Then it redirect to RedirectIDontWant2.com (not wanted) That redirect to RedirectIDontWant3.com (not wanted) => I blacklist RedirectIDontWant3.com

I open the main page a second time: PageIWant.com (wanted) Then it redirect to RedirectIDontWant1.com (not wanted) Then it redirect to RedirectIDontWant2.com (not wanted) That redirect to RedirectIDontWant3Alternate.com (not wanted) => I blacklist RedirectIDontWant3Alternate.com

It would be great if I can see all the redirects in a block.

Idea of implementation When I click on the "(Un)Block this page" Instead of showing Access to "RedirectIDontWant3.com" will be restricted with the following rules. Are you sure?

If should display Do you want to block this page? Access to "RedirectIDontWant3.com" will be restricted with the following rules. Are you sure? You can restrict [x] RedirectIDontWant1.com and [x] RedirectIDontWant2.com too

The plugin should be able to see the history of pages that have been open in the last 5 seconds to display them. (showing and limiting to the 10 least recent in case of massive redirects).

ray-lothian commented 1 year ago

This extension uses "declarativeNetRequest" rules to block or redirect pages. Since there isn't an observer in place to monitor requests, there's no means of tracking the sequence of redirects either.

gabrielklein commented 12 months ago

Can you do something with document.referrer ? This message should really be displayed when we block the page, not when the page is blocked.