From 0ee5f981f3e708246674d26f8a26fc9b6d8f5fc9 Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Tue, 1 Jan 2008 21:40:32 +0000 Subject: git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@101 119bf307-c92d-0410-89bd-8f53e6181181 --- chrome/content/help.html | 120 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 chrome/content/help.html (limited to 'chrome/content/help.html') diff --git a/chrome/content/help.html b/chrome/content/help.html new file mode 100644 index 0000000..a9f5245 --- /dev/null +++ b/chrome/content/help.html @@ -0,0 +1,120 @@ + + + Redirector Help + + + +

Redirector Help

+

Table of contents

+
    +
  1. What is Redirector?
  2. +
  3. Basic usage + +
  4. +
  5. Wildcards
  6. +
  7. Regular expressions
  8. +
  9. XPath redirects
  10. +
  11. Examples
  12. +
+ + + +

What is Redirector?

+ +

Redirector is an extension for Firefox that allows you to automatically redirect from + one webpage to another. For example, every time you visit http://abc.com you will automatically + load http://def.com instead. This can be useful for instance to always redirect articles to printer friendly + versions, redirect http:// to https:// for sites that support both, bypass advertising pages that appear before + being able to view certain pages and more.

+ + +

Basic usage

+

To add a new redirect you can go to the Tools menuitem and select Redirector. That will + open the Redirector settings window which shows all your redirects. The window can also be opened + by right clicking on the R icon in your statusbar and selecting Manage redirects. + There you can press the Add... button and then you can enter the details for the new redirect. A redirect + consists of a few things: +

+

+ + +

Wildcards

+ +

Wildcards are the simplest way to specify include and exclude patterns. When you create a wildcard pattern there + is just one special character, the asterisk *. An asterisk in your pattern will match zero or more characters and you can + have more than one star in your pattern. Some examples: +

+ $1, $2, $3 in the redirect urls will match the text that the stars matched. Examples: + +

+ + +

Regular expressions

+ +

Regular expressions allow for more complicated patterns but they are a lot harder to learn than wildcards. I'm not gonna + create a regex tutorial here but normal javascript regex syntax works, look at http://regular-expressions.info for + an introduction to regular expressions. $1,$2 etc. can be used in the redirect url and will be replaced with contents of captures in + the regular expressions. Captures are specified with parantheses. Example: http://example.com/index.asp\?id=(\d+) will match the url + http://example.com/index.asp?id=12345 and $1 will be replaced by 12345. (A common mistake in regex patterns is to forget to escape + the ? sign in the querystring of the url. ? is a special character in regular expressions so if you want to match an url with a querystring + you should escape it as \?).

+ + +

XPath redirects

+

The redirect url can be specified as an xpath expression by starting it with xpath: and then you will be redirected to the url + that the xpath expression matches. Example: Redirect url is xpath:/div/span/a/@href, then you will be redirected to the href value + of the first link that's inside a div in the original page.

+ + +

Examples

+ +

To be continued in next version...

+ + \ No newline at end of file -- cgit v1.2.3-70-g09d2