aboutsummaryrefslogtreecommitdiff
path: root/chrome/content/redirector.js
diff options
context:
space:
mode:
authorEinar Egilsson2007-10-05 21:10:42 +0000
committerEinar Egilsson2007-10-05 21:10:42 +0000
commitd30ede45e7ff0624ca4a1bcc565c344a6df23ee2 (patch)
treedb69cf7e65971d7764a9505afc2f36cb1ae6ac61 /chrome/content/redirector.js
parent44344acd49dbd1781825644deee839d7de132e00 (diff)
Redirector 1.0.2.1
git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@94 119bf307-c92d-0410-89bd-8f53e6181181
Diffstat (limited to 'chrome/content/redirector.js')
-rw-r--r--chrome/content/redirector.js36
1 files changed, 17 insertions, 19 deletions
diff --git a/chrome/content/redirector.js b/chrome/content/redirector.js
index 1c77ed6..cc09300 100644
--- a/chrome/content/redirector.js
+++ b/chrome/content/redirector.js
@@ -57,25 +57,23 @@ var Redirector = {
getRedirectUrlForInstantRedirect : function(url) {
var redirect, link, links, redirectUrl;
- if (!this.enabled) {
- return null;
- }
-
- for each (redirect in this.list) {
-
- redirectUrl = this.getRedirectUrl(url, redirect);
- //Can't do fast redirect if it requires that link exists
- //we need the original page to verify that it exists.
- //Slow redirect will be done automatically.
- if (redirectUrl) {
-
- if (!redirect.onlyIfLinkExists && !redirect.redirectUrl.startsWith('xpath:')) {
- RedirLib.debug('%1 matches %2, and it\'s not only if link exists and not an xpath expression. Can do instant redirect.'._(redirect.pattern, url));
- return { 'url' : redirectUrl, 'pattern' : redirect.pattern};
- } else if (redirect.redirectUrl.startsWith('xpath:')) {
- RedirLib.debug('%1 matches %2, but the redirect is a xpath expression and so has to be a slow redirect'._(redirect.pattern, url));
- } else {
- RedirLib.debug('%1 matches %2, but it\'s "only if link exists" and so has to be a slow redirect'._(redirect.pattern, url));
+ if (this.enabled) {
+
+ for each (redirect in this.list) {
+
+ redirectUrl = this.getRedirectUrl(url, redirect);
+ //Can't do fast redirect if it requires that link exists
+ //we need the original page to verify that it exists.
+ //Slow redirect will be done automatically.
+ if (redirectUrl) {
+ if (!redirect.onlyIfLinkExists && !redirect.redirectUrl.startsWith('xpath:')) {
+ RedirLib.debug('%1 matches %2, and it\'s not only if link exists and not an xpath expression. Can do instant redirect.'._(redirect.pattern, url));
+ return { 'url' : redirectUrl, 'pattern' : redirect.pattern};
+ } else if (redirect.redirectUrl.startsWith('xpath:')) {
+ RedirLib.debug('%1 matches %2, but the redirect is a xpath expression and so has to be a slow redirect'._(redirect.pattern, url));
+ } else {
+ RedirLib.debug('%1 matches %2, but it\'s "only if link exists" and so has to be a slow redirect'._(redirect.pattern, url));
+ }
}
}
}