Browser extension (Firefox, Chrome, Opera, Edge) to redirect URLs based on regex

92 Bluestein 45 6/1/2025, 7:13:46 AM github.com ↗

Comments (45)

rdmuser · 1d ago
Sadly late 2021 the original dev passed away. Someone has taken over stewardship of the project but it is currently moving slowly and they are seeking more contributors (javascript skills are a plus).

He was a bit of a hn user and seemed good natured and pleasant. Though I didn't know him I was sad to hear he'd passed both as a Redirector user and a fan of good people doing good things. I know he'd mentioned being happy to get recognition on here. https://news.ycombinator.com/user?id=einaregilsson

I really enjoyed the original devs write up on creating an easter egg specifically targeting Mark Hamills avatar in game. https://einaregilsson.com/an-easter-egg-for-one-user-luke-sk... https://news.ycombinator.com/item?id=30715746

rdmuser · 1d ago
Oups linked the wrong hn thread about that easter egg. Here is the one that got a bunch of attention back in 2017: https://news.ycombinator.com/item?id=14653017
out-of-ideas · 18h ago
for firefox, i use `request-interceptor` ( https://addons.mozilla.org/en-US/firefox/addon/request-inter... )

though sadly it has not had an update in a while (a dark mode would be great) (and rarely, a page-url match does not always match a request-rule where i believe some javahell shinanigans take over and somehow get their way)

Bluestein · 1d ago
Really sad to hear.-
kmfrk · 1d ago
Been using this for a long time, and it's fantastic.

I also found out that Kagi (the paid search engine) supports rewriting results, which is probably where you'll see a lot of the links you follow.[1]

For instance, if you get some Fandom results, you can change them to antifandom that is part of the BreezeWiki project[2], if you so prefer: https://forgottenrealms.antifandom.com.

[1]: https://kagi.com/settings/?p=redirects

[2]: https://antifandom.com

neodymiumphish · 20h ago
I’m a Kagi subscriber and didn’t know about this… thanks!!
Bluestein · 23h ago
> Kagi (the paid search engine) supports rewriting results

This is such a value-add! Pretty smart guys.-

nileshtrivedi · 1d ago
I find it annoying when people share direct URLs to PDFs at arxiv.org instead of the the abstract. However, if I were to use a redirect extension like this one, then my own click on the PDF link would get redirected back to the abstract page. To handle this, the redirect rule needs to consider the referer page too, with a possible exception if the referer is the same site as the destination.
imurray · 5h ago
I wrote firefox and chrome extensions that do exactly what you want:

Firefox: https://addons.mozilla.org/en-US/firefox/addon/redirectify/

Chrome: https://chrome.google.com/webstore/detail/redirectify/mhjmbf...

Source: https://github.com/imurray/redirectify

Sadly I never got around to making it configurable, so it's just a fixed table of rules for a handful of journal and pre-print sites.

mook · 1d ago
For something like that, on Android I find it fine to install the URL Forwarder app from F-droid and share the link to the app. That way you opt-in to the modification (I use it to load things with Archive.today from HN).
godelski · 18h ago
Dear god... this is a major pet peeve of mine. I frequently open the links on my phone and the pdf just eats data and results in a terrible reading experience.

The reason I open on my phone is because I find via places like HN, Twitter, Bsky, read the abstract, and then send the link back to my computer for later reading (Firefox send tabs). 99.9% of the time I do not want the pdf...

purpleidea · 1d ago
I've used this before, but the biggest missing feature is a compendium of built-in common fixes, like removing the &si= tracker junk off of youtube links, and so on...
schiffern · 6h ago
This is the "God-like powers" extension. The "set it and forget it" extension is called ClearURLs.

There's also Request Control, which is probably what you're looking for. More powerful than Redirector actually, but it comes with some common rules built in (not as comprehensive as ClearURLs though).

https://github.com/ClearURLs/Addon

https://github.com/slymax/request-control

dmit · 1d ago
Or these, which have their own Wikipedia page: https://en.wikipedia.org/wiki/UTM_parameters
ftk_ · 1d ago
If you have uBlock Origin installed you can enable URL tracking protection filter list or write your own filters `$removeparam=<tracker param>`.
DimitriBouriez · 1d ago
The extension is no longer available on Chrome. So, I am looking for a way to automatically redirect x.com to xcancel.com
Argonaut998 · 11h ago
Just write a simple user script with Tamper/Greasemonkey. You can even paste it into ChatGPT and it will give you one.
chris_pie · 1d ago
For this specific case there's a "Nitter Redirect" extension
aspenmayer · 1d ago
MallocVoidstar · 1d ago
This is also a MV2 extension and therefore also not available on Chrome.
schiffern · 4h ago
Not sure what search you're using, but Googling `xcancel redirect` gave me plenty on the first page. You could be stuck in a search bubble. Maybe try searching in private browsing mode?

This one is manifest v3: https://chromewebstore.google.com/detail/xcancelcom-redirect...

This userscript (despite the name) also redirects to xcancel: https://greasyfork.org/en/scripts/450008-twitter-to-nitter-r...

aspenmayer · 1d ago
MallocVoidstar · 1d ago
Chrome has disabled support for MV2 extensions (unless you set an enterprise policy) and is entirely removing support for MV2 extensions in v139: https://developer.chrome.com/docs/extensions/develop/migrate...

It releases in August.

spookie · 1d ago
Hope those Google guys fix it! Would be bad not having half of the appeal of the browser.
anonym29 · 1d ago
You're welcome to quit using spyware as your primary browser if you're dissatisfied with the spyware's treatment of your rights as a user.

If you choose not to, you should probably cede the right to complain about problems solved with MV2 extensions, since those problems are now self-inflicted.

aspenmayer · 1d ago
Ok.
Argonaut998 · 11h ago
All of this can be done with a simple script for Tamper/Grease/Violentmonkey if you don’t want to install an extension or are concerned about it not being supported in Manifest V3
userbinator · 1d ago
I use a filtering proxy to do this. Much more control, and as someone who regularly uses several browsers simultaneously, no need to configure each one separately.
Bluestein · 23h ago
There used to be this nice proxy-thing for windows called the "Proxomitron" (or such), peculiar one-eyed pyramid icon and everything! Wonder if it's still around. Been a while.-
userbinator · 23h ago
That's what I use.
Bluestein · 11h ago
Still around! :)
godelski · 18h ago
The first example makes me wonder: why is Wikipedia so... bad?

It can redirect mobile users to the mobile site but still serves desktop users the mobile site. Why is this reverse direction so hard?

What the fuck is up with the light/dark theme feature? I'm really happy they implemented it, but why is the default 'skin-theme-clientpref-day' (light theme)? Shouldn't the default be 'skin-theme-clientpref-os' (automatic)? What's the point of having "automatic" if it isn't... you know... automatic? It's literally a one liner (setting default value). Am I missing something much more nuanced?

I see stuff like this all the time, not just on Wiki. Stuff drives me nuts. Just adds needless extra work. I know it is kinda petty to complain about having to click an extra button or two, but I thought the whole point of programming was to automate stuff. Hell, how often do we automate stuff that doesn't need to be lol. Isn't the classic programmer problem that we spend more time automating and optimizing than would be saved by the automation? I mean the theme issue is 5 seconds of work and saves a billion users 2 seconds, each. That one seems worth it if there isn't some other issue.

hexage1814 · 1d ago
I use it all the time, pretty handy. Sadly, as people mentioned the original developer passed away and the community needs help, especially to port to manifest V3.
bonki · 1d ago
Curious, what are you using it for? Do you have a few examples?
hexage1814 · 1d ago
For instance, I use to: redirect new reddit site to old.reddit.com

I keep a blog on wordpress.com, but I really dislike their new blog admin interface, but the interface one can still be accessed , so I redirect to there to edit my posts on the old interface

I use some alternative front-ends, like imginn.com, which is alternative front-end to instagram, so I set to redirect links there.

This sort of thing.

hadrien01 · 1d ago
Redirects from translated versions of Google or Microsoft documentation to the English one. The Microsoft ones are okay-ish but I strongly prefer reading the original version. And the Google ones are a patchwork of machine-translated nonsense, "powered by Google Cloud Translation API"
Narishma · 1d ago
Mobile Wikipedia to normal Wikipedia.
snthd · 1d ago
The discontinued HTTPS Everywhere is the same thing, just that it came with a default https flavoured ruleset.
LargoLasskhyfv · 1d ago
aspenmayer · 1d ago
Also available from same dev on a non-GH host:

https://libredirect.codeberg.page/

altairprime · 1d ago
Safari users, Redirect Web is in the app store for this.
amitizle · 1d ago
Not to be that guy but sounds like a vulnerability waiting to happen
Bluestein · 1d ago
There seems to almost always be a tradeoff between how useful a piece of software potentially is, and how vulnerable, as in, how much of a desirable target ...
lupusreal · 1d ago
That's why I bricked up all of my windows. Glass is just too easy to break.
shaunpud · 8h ago
Please explain