warren-bank / moz-rewrite

"moz-rewrite" is a Firefox add-on that functions as a light-weight (pseudo) rules-engine for easily modifying HTTP headers in either direction
GNU General Public License v2.0
30 stars 7 forks source link

redirectTo redirects the whole browser window? #7

Closed mocking closed 7 years ago

mocking commented 9 years ago

I'm trying to replace the scripts loaded by a webpage by doing this, but now when a webpage loads that script, the whole browser gets redirected by redirectTo. I would expect only the script load gets redirected.

  {
    "url": /^https?:\/\/ajax.googleapis.com/i,
    "headers": function() {
      redirectTo(request.uri.href.replace("ajax.googleapis.com", "cdnjs.cloudflare.com"));
      return {};
    }
  }
wyzegob commented 8 years ago

waiting for 'redirectTo' everywhere ,not only reload the window.location.url.

warren-bank commented 7 years ago

Hi, sorry for not fixing this issue sooner.

An updated version 1.05 of the addon does exactly that. It's currently pending review on AMO, but works in versions of Firefox that still allow installation and use of unsigned addons (ex: Developer Edition, unbranded releases that are identical to those in the stable branch, etc)