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 can intercept and block requests in browsers. For example in Chrome you can use the `beforeload` event check if it's a JS (`event.target` is script tag or `event.url` ends in .js) call `event.preventDefault()` and then load your own script instead. 

I'm pretty sure there's a similar way to do this in FF.