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.
You should probably consider [robohydra](http://dev.opera.com/articles/view/robohydra-a-new-testing-tool-for-client-server-interactions/), since it is specifically developed for your case. They do not support https yet, but they are open to including it in the future.