penge/block-site

Can we add a redirect function?

Closed this issue · 4 comments

kachdi commented

Can we add a redirect function so when you try to enter a blocked site it redirects you to a judging picture of terry crews or something?

penge commented

hahha, Yes, we can have that

hi @penge if you have not started work on this, then I'd like to work on this issue.

This seems an easy and I'd like to give back for making this extension by making some contributions.

If my understanding is correct (I've not read your codebase yet), then I can use OnBeforeRequest to intercept/catch the requests.

And then I can update the tab in question, and redirect it to the URL set by User.

Let me know what you think.

penge commented

Hi @anshulxyz

what @kachdi actually ment, is to show ("redirect" to) Terry Crews picture, not block pages that cause redirect, which is btw something we already have implemented using: https://developer.chrome.com/docs/extensions/reference/webNavigation/#event-onBeforeNavigate

@penge right, I understood but maybe I failed to convey.

I'll rephrase, so basically instead of going to the blocked page that says "X was blocked" the tab will be redirected to a custom URL set by the User.