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.
+ 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:
+
+
Example url: This is an example of an url you want to redirect. It is not really used for anything,
+ it's just there to show what types of urls you're targetting. You can leave this out, but then you can't use the Test pattern button.
+
+
Include pattern: This is pattern for the urls you want to redirect. In the simplest case, where you just want
+ to redirect one specific url to another then this will just be the exact url you want to redirect. For instance, if you just want http://aaa.com to
+ redirect to http://bbb.com then Include pattern will just be http://aaa.com. For more complex patterns that match many
+ urls you can use either wildcards or regular expressions.
+
+
Exclude pattern: Urls that match this pattern will never be redirected. This is not necessary to
+ fill out, but can be useful when you want to redirect all urls that contain some text except if they contain some other text.
+ Redirects like that can often be done with a complex regular expression, but using an exclude pattern makes it much simpler. The exclude
+ patterns can use wildcard characters or regular expressions like the include patterns.
+
+
Redirect to: This is the url that you will be redirected to when you open any page where the url matches the
+ include pattern. You can use the special signs $1, $2, $3 etc. in the url, they will be replaced by the results of captures with regular
+ expressions or stars with wildcards. For instance, if you have the include pattern http://google.com/*, redirect to http://froogle.com/$1
+ and you open the page http://google.com/foobar, then you will be redireced to http://froogle.com/foobar, since 'foobar' was what the star replaced. $1 is for the
+ first star in the pattern, $2 for the second and so on. For regular expression $1 is for the first parantheses, $2 for the second etc.
+
+
Pattern type: This specifies how Redirector should interpret the patterns, either as
+ wildcards or regular expressions.
+
+
Unescape matches: A common usage of Redirector is to catch urls like
+ http://foo.com/redirect.php?url=http%3A%2F%2Fbar%2Ecom%2Fpath and try to catch the url parameter and redirect to it. A pattern
+ like http://foo.com/redirect.php?url=* might be used for that purpose. However, if the url parameter is escaped (also known
+ as urlencoded) then that won't work. In the url above we see that it starts with http%3A%2F%2F instead of http://, and Firefox
+ won't accept this as a new url to redirect to. So, in cases like these you can check the Unescape matches option and then all
+ matches will be unescaped (turned from e.g. http%3A%2F%2Fbar%2Ecom to http://bar.com) before being inserted into the target url.
+
+
+
+
+
+
+
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:
+
+
http://example.com/* matches http://example.com/, http://example.com/foo, http://example.com/bar and all other urls that start with http://example.com/.
+
http://*.example.com matches all subdomains of example.com, like http://www.example.com, http://mail.example.com.
+
http*://example.com matches both http://example.com and https://example.com.
+ $1, $2, $3 in the redirect urls will match the text that the stars matched. Examples:
+
+
http://example.com/* matches http://example.com/foobar, $1 is foobar.
+
http://*.example.com/* matches http://www.example.com/foobar, $1 is www, $2 is foobar.
+
+
+
+
+
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 \?).
+
+
+
Examples
+
+
+
+ Static redirect
+ Redirects from http://example.com/foo to http://example.com/bar
+
+ Include pattern: http://example.com/foo
+ Exclude pattern:
+ Redirect to: http://example.com/bar
+ Pattern type: Wildcard
+
+
+
+
+ Redirect using query string parameter and wildcards
+ Redirects from http://example.com/index.php?id=12345&a=b to http://example.com/printerfriendly.php?id=12345&a=b
+ where 12345 could be any number.
+
+ Include pattern: http://example.com/index.php?id=*&a=b
+ Exclude pattern:
+ Redirect to: http://example.com/printerfriendly.com?id=$1&a=b
+ Pattern type: Wildcard
+
+
+
+ Redirect using query string parameter and regular expressions
+ Redirects from http://example.com/index.php?id=12345&a=b to http://example.com/printerfriendly.php?id=12345&a=b
+ where 12345 could be any number.
+
+ Include pattern: http://example.com/index.php\?id=(\d+)&a=b
+ Exclude pattern:
+ Redirect to: http://example.com/printerfriendly.com?id=$1&a=b
+ Pattern type: Regular Expression
+
+
+
+ Redirect to a different folder using wildcards
+ Redirects from http://example.com/category/fish/index.php to http://example.com/category/cats/index.php
+ where fish could be any word. The exclude pattern makes sure that there is only one
+ folder there, so for instance http://example.com/category/fish/cat/mouse/index.php would not match.
+
+ Include pattern: http://example.com/category/*/index.php
+ Exclude pattern: http://example.com/category/*/*/index.php
+ Redirect to: http://example.com/category/cats/index.php
+ Pattern type: Wildcard
+
+
+
+ Redirect http to https using wildcards
+ Redirects from http://mail.google.com/randomcharacters to https://mail.google.com/randomcharacters
+ where randomcharacters could be anything.
+
+ Include pattern: http://mail.google.com*
+ Exclude pattern:
+ Redirect to: https://mail.google.com$1
+ Pattern type: Wildcard
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/chrome/ui/skin/movedown.png b/chrome/ui/skin/movedown.png
new file mode 100644
index 0000000..d32b79c
Binary files /dev/null and b/chrome/ui/skin/movedown.png differ
diff --git a/chrome/ui/skin/movedowndisabled.png b/chrome/ui/skin/movedowndisabled.png
new file mode 100644
index 0000000..afd8fc6
Binary files /dev/null and b/chrome/ui/skin/movedowndisabled.png differ
diff --git a/chrome/ui/skin/moveup.png b/chrome/ui/skin/moveup.png
new file mode 100644
index 0000000..3025378
Binary files /dev/null and b/chrome/ui/skin/moveup.png differ
diff --git a/chrome/ui/skin/moveupdisabled.png b/chrome/ui/skin/moveupdisabled.png
new file mode 100644
index 0000000..e526b29
Binary files /dev/null and b/chrome/ui/skin/moveupdisabled.png differ
diff --git a/chrome/ui/skin/redirector.css b/chrome/ui/skin/redirector.css
new file mode 100644
index 0000000..ff9762e
--- /dev/null
+++ b/chrome/ui/skin/redirector.css
@@ -0,0 +1,15 @@
+/* $Id$ */
+
+.disabledRedirect { color:grey; }
+#lstRedirects richlistitem { border-bottom:dotted 1px grey; padding:3px; }
+.redirectRows > row > label { font-weight:bold;}
+.editRedirects > row > textbox { width: 350px; }
+#redirectorSettings > tabbox { margin:4px; }
+#btnUp { list-style-image: url('chrome://redirector/skin/moveup.png'); }
+#btnDown { list-style-image: url('chrome://redirector/skin/movedown.png'); }
+#btnUp[disabled=true] { list-style-image: url('chrome://redirector/skin/moveupdisabled.png'); }
+#btnDown[disabled=true] { list-style-image: url('chrome://redirector/skin/movedowndisabled.png'); }
+
+#btnUp, #btnDown { width:25px; min-width:25px; }
+#lblExport, #lblImport { padding-top:5px; }
+#grpImportExport { padding-top:10px; padding-left:5px;}
\ No newline at end of file
diff --git a/chrome/ui/skin/redirector.png b/chrome/ui/skin/redirector.png
new file mode 100644
index 0000000..f8de12c
Binary files /dev/null and b/chrome/ui/skin/redirector.png differ
diff --git a/chrome/ui/skin/statusactive.png b/chrome/ui/skin/statusactive.png
new file mode 100644
index 0000000..06ce766
Binary files /dev/null and b/chrome/ui/skin/statusactive.png differ
diff --git a/chrome/ui/skin/statusinactive.png b/chrome/ui/skin/statusinactive.png
new file mode 100644
index 0000000..8b83562
Binary files /dev/null and b/chrome/ui/skin/statusinactive.png differ
diff --git a/components/interfaces/nsIFile.idl b/components/interfaces/nsIFile.idl
deleted file mode 100644
index cf97192..0000000
--- a/components/interfaces/nsIFile.idl
+++ /dev/null
@@ -1,343 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Communicator client code, released
- * March 31, 1998.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998-1999
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Doug Turner
- * Christopher Blizzard
- * Darin Fisher
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsISupports.idl"
-
-interface nsISimpleEnumerator;
-
-/**
- * This is the only correct cross-platform way to specify a file.
- * Strings are not such a way. If you grew up on windows or unix, you
- * may think they are. Welcome to reality.
- *
- * All methods with string parameters have two forms. The preferred
- * form operates on UCS-2 encoded characters strings. An alternate
- * form operates on characters strings encoded in the "native" charset.
- *
- * A string containing characters encoded in the native charset cannot
- * be safely passed to javascript via xpconnect. Therefore, the "native
- * methods" are not scriptable.
- *
- * @status FROZEN
- */
-[scriptable, uuid(c8c0a080-0868-11d3-915f-d9d889d48e3c)]
-interface nsIFile : nsISupports
-{
- /**
- * Create Types
- *
- * NORMAL_FILE_TYPE - A normal file.
- * DIRECTORY_TYPE - A directory/folder.
- */
- const unsigned long NORMAL_FILE_TYPE = 0;
- const unsigned long DIRECTORY_TYPE = 1;
-
- /**
- * append[Native]
- *
- * This function is used for constructing a descendent of the
- * current nsIFile.
- *
- * @param node
- * A string which is intended to be a child node of the nsIFile.
- * For the |appendNative| method, the node must be in the native
- * filesystem charset.
- */
- void append(in AString node);
- [noscript] void appendNative(in ACString node);
-
- /**
- * Normalize the pathName (e.g. removing .. and . components on Unix).
- */
- void normalize();
-
- /**
- * create
- *
- * This function will create a new file or directory in the
- * file system. Any nodes that have not been created or
- * resolved, will be. If the file or directory already
- * exists create() will return NS_ERROR_FILE_ALREADY_EXISTS.
- *
- * @param type
- * This specifies the type of file system object
- * to be made. The only two types at this time
- * are file and directory which are defined above.
- * If the type is unrecongnized, we will return an
- * error (NS_ERROR_FILE_UNKNOWN_TYPE).
- *
- * @param permissions
- * The unix style octal permissions. This may
- * be ignored on systems that do not need to do
- * permissions.
- */
- void create(in unsigned long type, in unsigned long permissions);
-
- /**
- * Accessor to the leaf name of the file itself.
- * For the |nativeLeafName| method, the nativeLeafName must
- * be in the native filesystem charset.
- */
- attribute AString leafName;
- [noscript] attribute ACString nativeLeafName;
-
- /**
- * copyTo[Native]
- *
- * This will copy this file to the specified newParentDir.
- * If a newName is specified, the file will be renamed.
- * If 'this' is not created we will return an error
- * (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST).
- *
- * copyTo may fail if the file already exists in the destination
- * directory.
- *
- * copyTo will NOT resolve aliases/shortcuts during the copy.
- *
- * @param newParentDir
- * This param is the destination directory. If the
- * newParentDir is null, copyTo() will use the parent
- * directory of this file. If the newParentDir is not
- * empty and is not a directory, an error will be
- * returned (NS_ERROR_FILE_DESTINATION_NOT_DIR). For the
- * |CopyToNative| method, the newName must be in the
- * native filesystem charset.
- *
- * @param newName
- * This param allows you to specify a new name for
- * the file to be copied. This param may be empty, in
- * which case the current leaf name will be used.
- */
- void copyTo(in nsIFile newParentDir, in AString newName);
- [noscript] void CopyToNative(in nsIFile newParentDir, in ACString newName);
-
- /**
- * copyToFollowingLinks[Native]
- *
- * This function is identical to copyTo with the exception that,
- * as the name implies, it follows symbolic links. The XP_UNIX
- * implementation always follow symbolic links when copying. For
- * the |CopyToFollowingLinks| method, the newName must be in the
- * native filesystem charset.
- */
- void copyToFollowingLinks(in nsIFile newParentDir, in AString newName);
- [noscript] void copyToFollowingLinksNative(in nsIFile newParentDir, in ACString newName);
-
- /**
- * moveTo[Native]
- *
- * A method to move this file or directory to newParentDir.
- * If a newName is specified, the file or directory will be renamed.
- * If 'this' is not created we will return an error
- * (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST).
- * If 'this' is a file, and the destination file already exists, moveTo
- * will replace the old file.
- *
- * moveTo will NOT resolve aliases/shortcuts during the copy.
- * moveTo will do the right thing and allow copies across volumes.
- * moveTo will return an error (NS_ERROR_FILE_DIR_NOT_EMPTY) if 'this' is
- * a directory and the destination directory is not empty.
- * moveTo will return an error (NS_ERROR_FILE_ACCESS_DENIED) if 'this' is
- * a directory and the destination directory is not writable.
- *
- * @param newParentDir
- * This param is the destination directory. If the
- * newParentDir is empty, moveTo() will rename the file
- * within its current directory. If the newParentDir is
- * not empty and does not name a directory, an error will
- * be returned (NS_ERROR_FILE_DESTINATION_NOT_DIR). For
- * the |moveToNative| method, the newName must be in the
- * native filesystem charset.
- *
- * @param newName
- * This param allows you to specify a new name for
- * the file to be moved. This param may be empty, in
- * which case the current leaf name will be used.
- */
- void moveTo(in nsIFile newParentDir, in AString newName);
- [noscript] void moveToNative(in nsIFile newParentDir, in ACString newName);
-
- /**
- * This will try to delete this file. The 'recursive' flag
- * must be PR_TRUE to delete directories which are not empty.
- *
- * This will not resolve any symlinks.
- */
- void remove(in boolean recursive);
-
- /**
- * Attributes of nsIFile.
- */
-
- attribute unsigned long permissions;
- attribute unsigned long permissionsOfLink;
-
- /**
- * File Times are to be in milliseconds from
- * midnight (00:00:00), January 1, 1970 Greenwich Mean
- * Time (GMT).
- */
- attribute PRInt64 lastModifiedTime;
- attribute PRInt64 lastModifiedTimeOfLink;
-
- /**
- * WARNING! On the Mac, getting/setting the file size with nsIFile
- * only deals with the size of the data fork. If you need to
- * know the size of the combined data and resource forks use the
- * GetFileSizeWithResFork() method defined on nsILocalFileMac.
- */
- attribute PRInt64 fileSize;
- readonly attribute PRInt64 fileSizeOfLink;
-
- /**
- * target & path
- *
- * Accessor to the string path. The native version of these
- * strings are not guaranteed to be a usable path to pass to
- * NSPR or the C stdlib. There are problems that affect
- * platforms on which a path does not fully specify a file
- * because two volumes can have the same name (e.g., mac).
- * This is solved by holding "private", native data in the
- * nsIFile implementation. This native data is lost when
- * you convert to a string.
- *
- * DO NOT PASS TO USE WITH NSPR OR STDLIB!
- *
- * target
- * Find out what the symlink points at. Will give error
- * (NS_ERROR_FILE_INVALID_PATH) if not a symlink.
- *
- * path
- * Find out what the nsIFile points at.
- *
- * Note that the ACString attributes are returned in the
- * native filesystem charset.
- *
- */
- readonly attribute AString target;
- [noscript] readonly attribute ACString nativeTarget;
- readonly attribute AString path;
- [noscript] readonly attribute ACString nativePath;
-
- boolean exists();
- boolean isWritable();
- boolean isReadable();
- boolean isExecutable();
- boolean isHidden();
- boolean isDirectory();
- boolean isFile();
- boolean isSymlink();
- /**
- * Not a regular file, not a directory, not a symlink.
- */
- boolean isSpecial();
-
- /**
- * createUnique
- *
- * This function will create a new file or directory in the
- * file system. Any nodes that have not been created or
- * resolved, will be. If this file already exists, we try
- * variations on the leaf name "suggestedName" until we find
- * one that did not already exist.
- *
- * If the search for nonexistent files takes too long
- * (thousands of the variants already exist), we give up and
- * return NS_ERROR_FILE_TOO_BIG.
- *
- * @param type
- * This specifies the type of file system object
- * to be made. The only two types at this time
- * are file and directory which are defined above.
- * If the type is unrecongnized, we will return an
- * error (NS_ERROR_FILE_UNKNOWN_TYPE).
- *
- * @param permissions
- * The unix style octal permissions. This may
- * be ignored on systems that do not need to do
- * permissions.
- */
- void createUnique(in unsigned long type, in unsigned long permissions);
-
- /**
- * clone()
- *
- * This function will allocate and initialize a nsIFile object to the
- * exact location of the |this| nsIFile.
- *
- * @param file
- * A nsIFile which this object will be initialize
- * with.
- *
- */
- nsIFile clone();
-
- /**
- * Will determine if the inFile equals this.
- */
- boolean equals(in nsIFile inFile);
-
- /**
- * Will determine if inFile is a descendant of this file
- * If |recur| is true, look in subdirectories too
- */
- boolean contains(in nsIFile inFile, in boolean recur);
-
- /**
- * Parent will be null when this is at the top of the volume.
- */
- readonly attribute nsIFile parent;
-
- /**
- * Returns an enumeration of the elements in a directory. Each
- * element in the enumeration is an nsIFile.
- *
- * @return NS_ERROR_FILE_NOT_DIRECTORY if the current nsIFile does
- * not specify a directory.
- */
- readonly attribute nsISimpleEnumerator directoryEntries;
-};
-
-%{C++
-#ifdef MOZILLA_INTERNAL_API
-#include "nsDirectoryServiceUtils.h"
-#endif
-%}
diff --git a/components/interfaces/nsISimpleEnumerator.idl b/components/interfaces/nsISimpleEnumerator.idl
deleted file mode 100644
index 3f0efbf..0000000
--- a/components/interfaces/nsISimpleEnumerator.idl
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsISupports.idl"
-
-/**
- * Used to enumerate over elements defined by its implementor.
- * Although hasMoreElements() can be called independently of getNext(),
- * getNext() must be pre-ceeded by a call to hasMoreElements(). There is
- * no way to "reset" an enumerator, once you obtain one.
- *
- * @status FROZEN
- * @version 1.0
- */
-
-[scriptable, uuid(D1899240-F9D2-11D2-BDD6-000064657374)]
-interface nsISimpleEnumerator : nsISupports {
- /**
- * Called to determine whether or not the enumerator has
- * any elements that can be returned via getNext(). This method
- * is generally used to determine whether or not to initiate or
- * continue iteration over the enumerator, though it can be
- * called without subsequent getNext() calls. Does not affect
- * internal state of enumerator.
- *
- * @see getNext()
- * @return PR_TRUE if there are remaining elements in the enumerator.
- * PR_FALSE if there are no more elements in the enumerator.
- */
- boolean hasMoreElements();
-
- /**
- * Called to retrieve the next element in the enumerator. The "next"
- * element is the first element upon the first call. Must be
- * pre-ceeded by a call to hasMoreElements() which returns PR_TRUE.
- * This method is generally called within a loop to iterate over
- * the elements in the enumerator.
- *
- * @see hasMoreElements()
- * @return NS_OK if the call succeeded in returning a non-null
- * value through the out parameter.
- * NS_ERROR_FAILURE if there are no more elements
- * to enumerate.
- * @return the next element in the enumeration.
- */
- nsISupports getNext();
-};
diff --git a/components/interfaces/nsISupports.idl b/components/interfaces/nsISupports.idl
deleted file mode 100644
index b1127b4..0000000
--- a/components/interfaces/nsISupports.idl
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * The mother of all xpcom interfaces.
- * @status FROZEN
- */
-
-/* In order to get both the right typelib and the right header we force
-* the 'real' output from xpidl to be commented out in the generated header
-* and includes a copy of the original nsISupports.h. This is all just to deal
-* with the Mac specific ": public __comobject" thing.
-*/
-
-#include "nsrootidl.idl"
-
-%{C++
-/*
- * Start commenting out the C++ versions of the below in the output header
- */
-#if 0
-%}
-
-[scriptable, uuid(00000000-0000-0000-c000-000000000046)]
-interface nsISupports {
- void QueryInterface(in nsIIDRef uuid,
- [iid_is(uuid),retval] out nsQIResult result);
- [noscript, notxpcom] nsrefcnt AddRef();
- [noscript, notxpcom] nsrefcnt Release();
-};
-
-%{C++
-/*
- * End commenting out the C++ versions of the above in the output header
- */
-#endif
-%}
-
-
-%{C++
-#include "nsISupportsBase.h"
-#include "nsISupportsUtils.h"
-%}
diff --git a/components/interfaces/nsrootidl.idl b/components/interfaces/nsrootidl.idl
deleted file mode 100644
index 0538e4b..0000000
--- a/components/interfaces/nsrootidl.idl
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Dan Rosen
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * Root idl declarations to be used by all.
- * @status FROZEN
- */
-
-%{C++
-
-#include "nscore.h"
-#include "prtime.h"
-
-/*
- * Forward declarations for new string types
- */
-class nsAString;
-class nsACString;
-
-/*
- * Start commenting out the C++ versions of the below in the output header
- */
-#if 0
-%}
-
-typedef boolean PRBool ;
-typedef octet PRUint8 ;
-typedef unsigned short PRUint16 ;
-typedef unsigned short PRUnichar;
-typedef unsigned long PRUint32 ;
-typedef unsigned long long PRUint64 ;
-typedef unsigned long long PRTime ;
-typedef short PRInt16 ;
-typedef long PRInt32 ;
-typedef long long PRInt64 ;
-
-typedef unsigned long nsrefcnt ;
-typedef unsigned long nsresult ;
-
-// XXX need this built into xpidl compiler so that it's really size_t or PRSize
-// and it's scriptable:
-typedef unsigned long size_t;
-
-[ptr] native voidPtr(void);
-[ptr] native charPtr(char);
-[ptr] native unicharPtr(PRUnichar);
-
-[ref, nsid] native nsIDRef(nsID);
-[ref, nsid] native nsIIDRef(nsIID);
-[ref, nsid] native nsCIDRef(nsCID);
-
-[ptr, nsid] native nsIDPtr(nsID);
-[ptr, nsid] native nsIIDPtr(nsIID);
-[ptr, nsid] native nsCIDPtr(nsCID);
-
-// NOTE: Be careful in using the following 3 types. The *Ref and *Ptr variants
-// are more commonly used (and better supported). Those variants require
-// nsMemory alloc'd copies when used as 'out' params while these types do not.
-// However, currently these types can not be used for 'in' params. And, methods
-// that use them as 'out' params *must* be declared [notxpcom] (with an explicit
-// return type of nsresult). This makes such methods implicitly not scriptable.
-// Use of these types in methods without a [notxpcom] declaration will cause
-// the xpidl compiler to raise an error.
-// See: http://bugzilla.mozilla.org/show_bug.cgi?id=93792
-
-[nsid] native nsIID(nsIID);
-[nsid] native nsID(nsID);
-[nsid] native nsCID(nsCID);
-
-[ptr] native nsQIResult(void);
-
-[ref, domstring] native DOMString(ignored);
-[ref, domstring] native DOMStringRef(ignored);
-[ptr, domstring] native DOMStringPtr(ignored);
-
-[ref, utf8string] native AUTF8String(ignored);
-[ref, utf8string] native AUTF8StringRef(ignored);
-[ptr, utf8string] native AUTF8StringPtr(ignored);
-
-[ref, cstring] native ACString(ignored);
-[ref, cstring] native ACStringRef(ignored);
-[ptr, cstring] native ACStringPtr(ignored);
-
-[ref, astring] native AString(ignored);
-[ref, astring] native AStringRef(ignored);
-[ptr, astring] native AStringPtr(ignored);
-
-%{C++
-/*
- * End commenting out the C++ versions of the above in the output header
- */
-#endif
-%}
diff --git a/components/interfaces/rdIMatchResult.idl b/components/interfaces/rdIMatchResult.idl
deleted file mode 100644
index 371a7d7..0000000
--- a/components/interfaces/rdIMatchResult.idl
+++ /dev/null
@@ -1,13 +0,0 @@
-/* $Id$ */
-#include "nsISupports.idl"
-
-[scriptable, uuid(cf89b480-bce3-11de-a0dd-028037ec0200)]
-interface rdIMatchResult : nsISupports {
-
- /* Attributes */
- readonly attribute wstring redirectTo;
- readonly attribute boolean isMatch;
- readonly attribute boolean isExcludeMatch;
- readonly attribute boolean isDisabledMatch;
-};
-
diff --git a/components/interfaces/rdIRedirect.idl b/components/interfaces/rdIRedirect.idl
deleted file mode 100644
index 0421d8e..0000000
--- a/components/interfaces/rdIRedirect.idl
+++ /dev/null
@@ -1,29 +0,0 @@
-/* $Id$ */
-#include "nsISupports.idl"
-#include "rdIMatchResult.idl"
-
-[scriptable, uuid(cb69ddf0-bce1-11de-8251-028037ec0200)]
-interface rdIRedirect : nsISupports {
-
- /* Attributes */
- attribute wstring exampleUrl;
- attribute wstring includePattern;
- attribute wstring excludePattern;
- attribute wstring redirectUrl;
- attribute wchar patternType;
- attribute boolean unescapeMatches;
- attribute boolean disabled;
-
- /* Methods */
- rdIRedirect clone();
- void compile();
- void copyValues(in rdIRedirect other);
- void deserialize(in wstring data);
- boolean equals(in rdIRedirect other);
- rdIMatchResult getMatch(in wstring url);
- boolean isRegex();
- boolean isWildcard();
- wstring serialize();
- rdIMatchResult test(in wstring url);
-};
-
diff --git a/components/interfaces/rdIRedirector.idl b/components/interfaces/rdIRedirector.idl
deleted file mode 100644
index 2bd2eff..0000000
--- a/components/interfaces/rdIRedirector.idl
+++ /dev/null
@@ -1,23 +0,0 @@
-/* $Id$ */
-#include "nsISupports.idl"
-#include "nsIFile.idl"
-#include "rdIRedirect.idl"
-
-[scriptable, uuid(cdf25d91-bce1-11de-aee1-028037ec0200)]
-interface rdIRedirector : nsISupports {
-
- attribute boolean enabled;
- readonly attribute short redirectCount;
-
- void addRedirect(in rdIRedirect redirect);
- void debug(in wstring msg);
- void deleteRedirectAt(in short index);
- void exportRedirects(in nsIFile file);
- rdIRedirect getRedirectAt(in short index);
- wstring getRedirectUrl(in wstring url);
- long importRedirects(in nsIFile file);
- void reload();
- void save();
- void switchItems(in short index1, in short index2);
-};
-
diff --git a/components/interfaces/xpidl.exe b/components/interfaces/xpidl.exe
deleted file mode 100644
index cb39712..0000000
Binary files a/components/interfaces/xpidl.exe and /dev/null differ
diff --git a/install.rdf b/install.rdf
index 5ce1025..6e3a212 100644
--- a/install.rdf
+++ b/install.rdf
@@ -4,7 +4,7 @@
redirector@einaregilsson.comRedirector
- 2.5.2
+ 2.6Einar Egilssonquaful Zhang (Simplified Chinese locale)Automatically redirects to user-defined urls on certain pages
@@ -15,7 +15,7 @@
{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
- 3.5
+ 5.06.*
diff --git a/locale/en-US/browserOverlay.xul.dtd b/locale/en-US/browserOverlay.xul.dtd
new file mode 100644
index 0000000..3aaa0fc
--- /dev/null
+++ b/locale/en-US/browserOverlay.xul.dtd
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/locale/en-US/editRedirect.xul.dtd b/locale/en-US/editRedirect.xul.dtd
new file mode 100644
index 0000000..4b48d9c
--- /dev/null
+++ b/locale/en-US/editRedirect.xul.dtd
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/locale/en-US/redirector.properties b/locale/en-US/redirector.properties
new file mode 100644
index 0000000..128d08e
--- /dev/null
+++ b/locale/en-US/redirector.properties
@@ -0,0 +1,33 @@
+# $Id$
+initError=Failed to initialize Redirector.
+extensions.redirector@einaregilsson.com.description=Automatically redirects to user-defined urls on certain pages
+extensionName=Redirector
+addCurrentUrl=Add current url to Redirector
+addLinkUrl=Add link url to Redirector
+recursiveError=A redirect with the pattern %S matches %S and is trying to redirect to it again. You should change this rule so it won't work recursively.
+enabledTooltip=Redirector is enabled
+disabledTooltip=Redirector is disabled
+testPatternSuccess=The pattern %S matches example URL %S, and would redirect you to url: %S
+testPatternFailure=The pattern %S does not match example URL %S
+testPatternExclude=Example URL %S matches the exclude pattern %S and so would not be redirected
+regexPatternError=The pattern '%S' is not a legal regular expression pattern. Details: %S
+xpathDeprecated=XPath patterns are no longer supported as of version 1.5.1, please remove those redirects.
+redirectorFiles=Redirector files (*.rdx)
+exportCaption=Export redirects...
+importCaption=Import redirects...
+deleteConfirmationText=Are you sure you want to permanently delete this redirect?
+deleteConfirmationTitle=Delete redirect?
+importedMessage=%S redirects were imported
+importedMessageSingular=%S redirect was imported
+existedMessage=%S redirects were identical to existing redirects and were therefore not imported.
+existedMessageSingular=%S redirect was identical to an existing redirect and was therefore not imported.
+allExistedMessage=All %S redirects in the file were identical to existing redirects, no redirects were imported.
+allExistedMessageSingular=The single redirect in the file was identical to an existing redirect and was therefore not imported.
+importedNone=There were no usable redirects in the given file, no redirects were imported.
+importResult=Import results
+invalidRedirectTitle=Redirector Add-on: Invalid Redirect detected
+invalidRedirectText=The pattern "%S" redirected the url %S to %S which also matches the pattern. This will cause an endless loop and so the redirect has been disabled to prevent this from happening. You should edit this redirect to fix it.
+warningExampleUrlDoesntMatchPatternTitle=Warning: Example url does not match redirect
+warningExampleUrlDoesntMatchPattern=The example url does not match the redirect specified. Are you sure you want to save this redirect?
+errorExampleUrlMatchesRecursiveTitle=Error: Recursive match detected
+errorExampleUrlMatchesRecursive=The example url %S matches the redirect and would redirect you to %S, which also matches the redirect. This is not allowed as it can cause an endless loop of requests.
\ No newline at end of file
diff --git a/locale/en-US/settings.xul.dtd b/locale/en-US/settings.xul.dtd
new file mode 100644
index 0000000..ff55b68
--- /dev/null
+++ b/locale/en-US/settings.xul.dtd
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/locale/zh-CN/browserOverlay.xul.dtd b/locale/zh-CN/browserOverlay.xul.dtd
new file mode 100644
index 0000000..b0567f8
--- /dev/null
+++ b/locale/zh-CN/browserOverlay.xul.dtd
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/locale/zh-CN/editRedirect.xul.dtd b/locale/zh-CN/editRedirect.xul.dtd
new file mode 100644
index 0000000..f0ab422
--- /dev/null
+++ b/locale/zh-CN/editRedirect.xul.dtd
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/locale/zh-CN/redirector.properties b/locale/zh-CN/redirector.properties
new file mode 100644
index 0000000..866ec1a
--- /dev/null
+++ b/locale/zh-CN/redirector.properties
@@ -0,0 +1,33 @@
+# $Id: redirector.properties 288 2009-10-26 08:13:15Z einar@einaregilsson.com $
+initError=Failed to initialize Redirector.
+extensions.redirector@einaregilsson.com.description=根据您设置的规则自动跳转网页。
+extensionName=Redirector
+addCurrentUrl=Add current url to Redirector
+addLinkUrl=为链接创建 Redirector 规则
+recursiveError=A redirect with the pattern %S matches %S and is trying to redirect to it again. You should change this rule so it won't work recursively.
+enabledTooltip=Redirector is enabled
+disabledTooltip=Redirector is disabled
+testPatternSuccess=The pattern %S matches example URL %S, and would redirect you to url: %S
+testPatternFailure=The pattern %S does not match example URL %S
+testPatternExclude=Example URL %S matches the exclude pattern %S and so would not be redirected
+regexPatternError=The pattern '%S' is not a legal regular expression pattern. Details: %S
+xpathDeprecated=XPath patterns are no longer supported as of version 1.5.1, please remove those redirects.
+redirectorFiles=Redirector files (*.rdx)
+exportCaption=Export redirects...
+importCaption=Import redirects...
+deleteConfirmationText=Are you sure you want to permanently delete this redirect?
+deleteConfirmationTitle=Delete redirect?
+importedMessage=%S redirects were imported
+importedMessageSingular=%S redirect was imported
+existedMessage=%S redirects were identical to existing redirects and were therefore not imported.
+existedMessageSingular=%S redirect was identical to an existing redirect and was therefore not imported.
+allExistedMessage=All %S redirects in the file were identical to existing redirects, no redirects were imported.
+allExistedMessageSingular=The single redirect in the file was identical to an existing redirect and was therefore not imported.
+importedNone=There were no usable redirects in the given file, no redirects were imported.
+importResult=Import results
+invalidRedirectTitle=Redirector Add-on: Invalid Redirect detected
+invalidRedirectText=The pattern "%S" redirected the url %S to %S which also matches the pattern. This will cause an endless loop and so the redirect has been disabled to prevent this from happening. You should edit this redirect to fix it.
+warningExampleUrlDoesntMatchPatternTitle=Warning: Example url does not match redirect
+warningExampleUrlDoesntMatchPattern=The example url does not match the redirect specified. Are you sure you want to save this redirect?
+errorExampleUrlMatchesRecursiveTitle=Error: Recursive match detected
+errorExampleUrlMatchesRecursive=The example url %S matches the redirect and would redirect you to %S, which also matches the redirect. This is not allowed as it can cause an endless loop of requests.
\ No newline at end of file
diff --git a/locale/zh-CN/settings.xul.dtd b/locale/zh-CN/settings.xul.dtd
new file mode 100644
index 0000000..0facb3a
--- /dev/null
+++ b/locale/zh-CN/settings.xul.dtd
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--
cgit v1.2.3-70-g09d2