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: 
I think this is a task for a personal proxy. You can sniff traffic on the proxy and apply rules to modify requests/content
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.