diff options
| -rw-r--r-- | chrome/content/overlay.js | 4 | ||||
| -rw-r--r-- | chrome/content/overlay.xul | 2 | ||||
| -rw-r--r-- | chrome/content/redirector.js | 36 | ||||
| -rw-r--r-- | install.rdf | 2 | 
4 files changed, 21 insertions, 23 deletions
| diff --git a/chrome/content/overlay.js b/chrome/content/overlay.js index 7795372..b7bd560 100644 --- a/chrome/content/overlay.js +++ b/chrome/content/overlay.js @@ -160,11 +160,11 @@ var RedirectorOverlay = {          var statusImg = $('redirector-statusbar-img');          if (RedirLib.getBoolPref('enabled')) { -            statusImg.src = 'chrome://redirector/content/statusactive.png' +            statusImg.src = 'chrome://redirector/content/statusactive.PNG'              statusImg.setAttribute('tooltiptext', this.strings.getString('enabledTooltip'));              Redirector.enabled = true;          } else { -            statusImg.src = 'chrome://redirector/content/statusinactive.png' +            statusImg.src = 'chrome://redirector/content/statusinactive.PNG'              statusImg.setAttribute('tooltiptext', this.strings.getString('disabledTooltip'));              Redirector.enabled = false;          } diff --git a/chrome/content/overlay.xul b/chrome/content/overlay.xul index d180d1f..e229530 100644 --- a/chrome/content/overlay.xul +++ b/chrome/content/overlay.xul @@ -26,7 +26,7 @@    </popup>    <statusbar id="status-bar">    <statusbarpanel id="redirector-status"> -      <image id="redirector-statusbar-img" src="chrome://redirector/content/statusactive.png" +      <image id="redirector-statusbar-img" src="chrome://redirector/content/statusactive.PNG"               tooltiptext="Redirector is enabled;"               style="width:16px; height:16px;"               onclick="RedirectorOverlay.toggleEnabled();" /> 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)); +                    }                  }              }          } diff --git a/install.rdf b/install.rdf index 2b96523..48256b6 100644 --- a/install.rdf +++ b/install.rdf @@ -5,7 +5,7 @@    <Description about="urn:mozilla:install-manifest">      <em:id>redirector@einaregilsson.com</em:id>      <em:name>Redirector</em:name> -    <em:version>1.0.1</em:version> +    <em:version>1.0.2.1</em:version>      <em:creator>Einar Egilsson</em:creator>      <em:description>Automatically redirects to user-defined urls on certain pages</em:description>      <em:homepageURL>http://tech.einaregilsson.com/projects/redirector/</em:homepageURL> | 
