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: 
Try <http://www.fiddler2.com/fiddler2/version.asp>

It does that and much more. But it's not a browser extension.
Disclaimer: I'm the author of the software :-)

A different approach that *might* suit your usecase better is to use a RoboHydra-based development proxy. The idea here would be that you want to keep ALL Javascript files in your machine, and use another server simply as a backend. It's great for eg. front-end developers that don't want to have the whole backend installed in their machines.

You can see the documentation, tutorials and such at <http://robohydra.org/>, and have an article describing exactly that usecase at <http://dev.opera.com/articles/view/robohydra-a-new-testing-tool-for-client-server-interactions/>.

However, as of now it can't proxy to HTTPS URLs, but that should be a trivial change that I intend to do soon anyway.