应用截图

Redirect Link截图1
Redirect Link截图2

详细介绍

Redirect a link to somewhere else.

Usage

You can redirect links and the current page. Current page can be redirected by clicking the right mouse button on the page, not on any kind of media or other elements, but basically the background.

Left mouse click redirects in the current tab and the middle and the right one to a new tab when using the toolbar popup.

Watch a demo video what this add-on does.

https://fluks.github.io/redirect-link/demo.ogv

---

Options

The URL field denotes where the page or the link is redirected to. It must start with a scheme, e.g. https://. It can contain formats, which are replaced by the component parts of the link's or page's URL. If the URL doesn't contain any formats, the link's or page's URL is appended to this URL.

Formats
%u - entire URL
%s - scheme
%h - hostname
%p - whole path without the leading slash, or %p[N], where N is index of the path part. e.g. in http://example.com/a/b/c?param=1, %p[0] is a, %p[1] is b and %p[2] is c
%q - all query parameters, or %q[KEY], where KEY is the name of the query parameter. e.g. in http://example.com/?a=1&b=2, %q[a] is 1 and %q[b] is 2
%f - fragment
%r[REGEX] - the regular expression is replaced with the match, or if capture groups are used, their matches are concatenated or empty string if there's no match. Right square brackets must be escaped in the regex. E.g. https://%r[[a-z.\]+]
%g[N] - Capturing group from EnableURL field, where N is the index of captured group.
%e[/REGEX/REPLACEMENT/FLAGS] - Replace REGEX with REPLACEMENT and optionally use FLAGS (i, g, etc.) using link/page URL as input. If you put some format before this format, it is used as input for this format. Example: http://a.com/%p[1]%e[/a|b|c/x/g] - %p[1] is used for input for %e and it changes all occurances of a, b and c to x from %p[1]

There are examples in the other screenshot.

To enable a redirection everywhere, leave Enable URL field empty. If you want to enable it only on certain URLs, add the URL or part of