Question: I'm looking for a browser extension (Firefox, Chrome) allowing to replace a Javascript file on a live Web site to do some testing/hacking.

Basically, it should take a URL and load another one instead (locally or on a HTTP development server).

Any idea?

Answer: 
Not sure if this helps or not, but I just encountered a chrome plugin called Resource Override, which sounds like it does something similar. Im trying out the Fiddler which someone else mentioned, but I think i'm also going to try this one at some point. <https://chrome.google.com/webstore/detail/resource-override/pkoacgokdfckfpndoffpifphamojphii?hl=en>
There is [https everywhere which lets you define rules for url rewrites](https://www.eff.org/https-everywhere/rulesets). This should work on all request, including script requests.

[Tamper](https://addons.mozilla.org/en-us/firefox/addon/tamper-data/) data might do the job, but I don't know how automated/permanent you can set it up.

And there is also an extension called [redirector](https://addons.mozilla.org/en-us/firefox/addon/redirector/). I didn't test that one. Potentially it only works on the address bar.

Update:

That is unfortunate. In that case probably a proxy is you only way. What about a firefox extension that is a proxy, like [Foxyproxy](http://getfoxyproxy.org/)