I'd like to get back to Fiddler. After having played with that for a while, it is clearly the best way to edit any web requests on-the-fly. Being JavaScript, POST, GET, HTML, XML whatever and anything. It's free, but a little tricky to implement. Here's my HOW-TO:
To use Fiddler to manipulate JavaScript (on-the-fly) with Firefox, do the following:
1) Download and install Fiddler
2) Download and install the Fiddler extension: "3 Syntax-Highlighting add-ons"
3) Restart Firefox and enable the "FiddlerHook" extension
4) Open Firefox and enable the FiddlerHook toolbar button:
View > Toolbars > Customize...
5) Click the Fiddler tool button and wait for fiddler to start.
6) Point your browser to Fiddler's test URLs:
Echo Service: http://127.0.0.1:8888/
DNS Lookup: http://www.localhost.fiddler:8888/
7) Add Fiddler Rules in order to intercept and edit JavaScript
before reaching the browser/server. In Fiddler click:
Rules > Customize Rules...
. [CTRL-R]
This will start the ScriptEditor.
8) Edit and Add the following rules:
a) To pause JavaScript to allow editing, add under the function "OnBeforeResponse":
if (oSession.oResponse.headers.ExistsAndContains("Content-Type", "javascript")){
oSession["x-breakresponse"]="reason is JScript";
}
b) To pause HTTP POSTs to allow editing when using the POST verb, edit "OnBeforeRequest":
if (oSession.HTTPMethodIs("POST")){
oSession["x-breakrequest"]="breaking for POST";
}
c) To pause a request for an XML file to allow editing, edit "OnBeforeRequest":
if (oSession.url.toLowerCase().indexOf(".xml")>-1){
oSession["x-breakrequest"]="reason_XML";
}
[9] TODO: Edit the above CustomRules.js
to allow for disabling (a-c).
10) The browser loading will now stop on every JavaScript found and display a red pause mark for every script. In order to continue loading the page you need to click the green "Run to Completion" button for every script. (Which is why we'd like to implement [9].)