Rewrite URLs according to a custom regex when accessing a web page.
NOTES:
* Don't let the unimpressive rating fool you. This is a simple, no-nonsense extension that does exactly what it says and no more. You have to know how to create a Javascript-flavor regular expression to use it.
* Chrome will inform you that this extension can "Read your browsing history". This is a result of two permissions that we require: "webNavigation" to intercept navigation requests and rewrite the URL, and "tabs" to open the existing extension options page (if already exists) instead of creating a new one when you click on the icon. I do not care about your browsing history.
WHAT'S NEW:
* You can now remove part of a URL by leaving the replacement text blank.
* The test page warns you if your rewrite rule is going to remove the protocol (http://, https://) from URLs making them relative.
Based on "Host name rewriter" by Mattias Lundberg.
URL Rewriter edits certain URLs, whether typed in or linked, via a set of rules before navigating to the URL. A rule consists of a regular expression specified in capture groups, a capture group number to replace, and the replacement text for that group. When you click on a link or type a URL in the address bar, it is checked against each of the rules. If a matching rule is found, the text of the specified capturing group number is replaced with the specified text.
Example:
- Regex: ^(http[s]?\:\/\/.*\.)(toothboiler)(\..*\/watch\?v=.*)$
- Group number to replace: 2
- Replacement text: youtube
- If you click a link for "http://www.toothboiler.com/watch?v=abcdefg";, it matches the regex rule and capture group 2 ("toothboiler") is replaced with "youtube" to result in "http://www.youtube.com/watch?v=abcdefg";.
Latest reviews
- (2021-07-25) Oscar S: Hard to use if you are not familier with those expressions
- (2021-07-09) Jeff Olvesen: Does just what I need. Thanks!
- (2021-05-19) Krassimir Manolov: It does what is says it will do. Nice and simple. Docked a star due to the slight issue where URLs opened in a new tab are not re-written.
- (2021-04-22) Neal DeBuhr: Latest version works as expected. My use case: rewriting URLs opened in a new tab via link.
- (2021-04-01) Cees Wesseling: Works as advertized
- (2021-02-16) Alan Burgesser: Will not actually change URLs tried to use it to recover URLs from broken extension URLs (verified possible by hand). Test case works as expected, but extension would never modify the actual URL.
- (2021-02-09) Valentine S.: Doesn't rewrite if open from hyperlink
- (2021-02-08) Nathan Hintzbergen: Only the first rewrite rule works.
- (2020-12-09) Martin Haitsma: After setting up the regex, I can see that it can parse and rewrite the URL in the tester. But then, when posting the URL in the Address Bar, nothing is happening - still opening the original URL.
- (2020-11-16) Fritz Vollmer: Extension itself works as expected. But left my system with ~20-30% CPU load when idle. Load disappeared when deactivating the extension. Even after several restarts/reboots.
- (2020-10-30) Jonathan RABAU: It works as advertised ! :-D I really bothered me to always change the domain name of the links my colleagues sent me. Now, I can just click on the link and it replaces the domain name automatically. Thank you !
- (2020-10-02) Keith Zantow: First, this broke Chrome: all clicks went to the settings page. I reinstalled, then it sorta worked but when opening a link, it OPENED THE FULL LINK and THEN replaced it, so the original, tracked link still got accessed. 👎
- (2020-09-14) Jarek Hartman: Sad to say - does not work. After setting up the regex, I can see that it can parse and rewrite the URL in the tester. But then, when posting the URL in the Address Bar, nothing is happening - still opening the original URL.
- (2020-07-04) Scott Becker: Doesn't work. Maybe it worked at some point. I copied the test url I was using that had the correct rewrite happening in settings into the url bar, hit enter, and its not rewritten.
- (2020-04-10) Aleksey Egorov: I cannot replace multiple groups :( e.g., I want to replace https://t.me/s/group?before=308 to tg://resolve?domain=s?before=308&post=SLivyTGM
- (2020-04-08) LOLNATIONCH: If you want to modify links when you click url, this is for you. My use case, url that cannot be access without rdp, but has a second access point using only the vpn, but with a different url. Was very annoying when looking at my email on my computer without rdp. Had to modify 2 group, so I made two rule. Would have rated 5 stars if you could replace an N number of group with N text.
- (2020-03-16) Autoplay: Awesome!
- (2020-03-07) Igor Polovykh: This is a good idea but regular expression is not work at all. Coder gets mark 2-
- (2020-02-17) Tyler Gary: At first glance, regex will work as it should on the test section of the options page, but you may wonder why the extension does not modify URLs in practice. Another commenter highlighted the issue: you must refresh the page for the edit to apply. I'll take an extra F5 over clicking around with the mouse any day of the week, but I wish it would filter on first submission.
- (2020-02-04) Nils Jakobson: Does not work. Wasted like 30 minutes thinking I am totally lost with regexps but apparently it simply does not work. Gotta read comments before you download plugins. Lesson learned.
- (2019-12-24) Nick Bamji: Unfortunately didn't work for me either. Regex is good and expands correctly in the test box. Copying and pasting URLs into the test box lets you copy and paste the resulting URL out...but the extension doesn't replace either linked or typed URLs. Maybe Google changed a Chrome feature since the last update? Example of a non-working regex: ^(http[s]?\:\/\/uk-mkivs.net\/)(topic\/)(.*) Replace group 2 with "index.php?showtopic=" Should replace eg "https://uk-mkivs.net/topic/126816-rear-headrests/" with "https://uk-mkivs.net/index.php?showtopic=126816-rear-headrests/" but doesn't.
- (2019-09-25) Micheal Espinola: TDLR: It works. Its effective. It could use some refinements. At its core, it does exactly what its intended to do, which is a regular expression search and replace of the URL. The organization of the information however is cumbersome with no compressed list layout or sorting ability. There are greasemonkey scripts that can do the same, but allow you to see your arguments in a organizable list format. If this extension would allow for something like that, then I would give it would 5 out of 5 instead of 4 out of 5 stars. What gives this extension its 4 stars instead of less, is its convenience to test your regular expression without having to go to a 3rd party website or load up a regex utility.
- (2019-08-22) Jan Killian: Works perfectly in both Chrome and Opera. Thanks!
- (2019-08-19) Michael Koeber: only seems to work on pasted URLs even though it's description says it works on links as well Edit: to get it working on links, you just need to reload the page each time. [Assuming that's universal], put that in the description and I'd rate this 5 stars.
- (2019-08-08) Sergio Martins: Great Extension very good, does just what it should, i give 5 stars when url changes in this case: I am on a website yyyy.com and i click on a link that takes me to zzzzzz.com, i have a rule to zzzzzz.com replace by zzzzzz.net but as i didn't open in a new window or tab the regex is not applied. The extension should work every time you change the address or click on a link, and currently only works when I change the address bar.
- (2019-05-13) M Yussuf: Does what it says. Upvoting.
- (2019-05-09) M: Perfect! Goodbye Youtube, hello Invidio!
- (2019-03-18) Does exactly what it says it does, and no more. Tip: You must have a group for every piece of the URL you'd like to retain.
- (2019-02-07) Dan Church: Didn't do what I expected; I wanted to use this to modify ALL requests to a specific domain (e.g. for embedded CSS URL's) but sadly this only picks up and modifies URL's visited in the address bar.
- (2018-12-16) Balázs Szabó: It took some time until I figured out how it works, but after that, it is working well. What I expected is that I have a regex matcher with one group in it, and it replaced the matched group with something else, for example I expected to write something like that: (www\.|web\.|m\.)facebook.com, replace group 1 with empty string, but instead I have to create groups for everything that remains, too, like: (https?://)(www\.|web\.|m\.)(facebook.com.*), replace group 2 with empty string.
- (2018-10-22) Klaus Reimer: Unfortunately it only works with the URLs I enter into the URL bar of the browser. It doesn't rewrite URLs requested with the Fetch API or Image source URLs...
- (2018-07-26) Howard L Frederick: Very good - does just what it should! Having some examples in the main window would help, and a small regex cheatsheet.
- (2018-06-11) Tynach: This extension doesn't implement basic regex replace functionality. You can't have a single rule modify more than one part of the URL.
- (2016-04-14) Scott Morris: Didn't seem to work - even when you plug in the example content. Sad, this is exactly what I'm after!!
- (2015-11-23) Oleg Stepin: Great idea, but extension does not work :( Even the example from extension overview.
- (2015-07-15) MRNIKUSHA101: SUCKS
- (2015-06-18) Ahmad Gharbeia: To the point. Unusual among Chromium extensions.
Statistics
Installs
2,334
history
Category
Rating
3.0 (41 votes)
Last update / version
2018-05-23 / 0.13
Listing languages